Install phpESP on DreamHost

apps

#1

I would like to install phpESP v 1.8 into my directory with DreamHost. I’m not an expert, but I’ve had experience with tinkering with installing web packages, and I’ve not had success with phpESP. My questions:

Has any current DreamHost subscriber been able to successfully install this package?

Any ideas about what I’ve done wrong when I’ve unzipped the tarball and moved the directory to the name that I want in the URL (i.e. http://mydomain.com/survey/), and then I get a 404 error after being redirected to this site:
http://www.mydomain.com/cgi-system/admin/manage.php

As long as I know that it is possible, I can proceed to ask questions to others who may know. If there’s someone willing to tutor me through the install process, a grad student trying to do online surveys would be appreciative.

Thank you.


#2

I haven’t used that phpESP package, but I downloaded it and picked through it. I can tell you what is going wrong… in your /survey/ directory there should be an index.php that doen’t actually do anything but redirect to admin/manage.php . This script attempts to use $_SERVER[‘SCRIPT_NAME’] to obtain the directory of the script, however this is wrong on PHP4 when PHP4 is used as a CGI. There are two things you can do, either change the reference from [‘SCRIPT_NAME’] to [‘SCRIPT_URL’], or at the bottom of the script change the $url=sprintf(blah blah blah); line to just $url=“http://mydomain.com/survey/admin/manage.php”; (using the example you gave)

Since I haven’t actually used this app, I don’t know why exactly this redirect exists, it may be that after you first use the script, it is supposed to redirect somewhere other than the manage.php script, in which case you might have to edit the file again to point to the new file. Also, there may be other places in the script where SCRIPT_NAME was used. You’ll need to change these as well.


#3

Thank you, derfk, for getting me one step further. At the bottom of the index.php script I changed the $url= line as you directed. The redirect worked properly, but then I got this 503 error:

HTTP 503 Service Unavailable
[ Connection to database failed. Please check configuration. ]

I searched the manage.php file and the phpesp.ini.php, and there weren’t any SCRIPT_NAME references.


#4

You have to set up the PHPesp database before the admin page will work. There are three steps to this.

First create a new database using the DH webpanel. Then you have to use the command line to run a script which configures the database for you. For this step you have to ssh into your dreamhost account and type this command: mysql -u username-of-the-database-administrator -p -h mysql.your-database-domain.com phpesp < /folder-where-your-website-is-stored/folder-where-you-put-PHPesp/scripts/db/mysql_populate.sql

Then you have to find the file inside the admin folder called “phpESP.ini.php”. Open that file in a text editor and edit a couple of settings. Namely, the location where your PHPesp is installed, the database name and the database admin name.

Incidentally, you can find these instructions in /docs/intall in the PHPesp package you downloaded. Also, if you go to www.yoursite.com/survey/admin/test.php you will find some useful info.