Subscribe to blog updates via email »

PHPSurveyor Questions Not Displaying? Check Your Session

June 08 2005 – 01:24pm

I just spent two days pulling my hair out over trying to get PHP Surveyor to work. It’s a great (free!) PHP/MySQL-based web survey application, but after I was done making my survey, none of the questions would display.


After much experimentation and searching I found this FatCow knowledgebase article, that tells you to change your PHP session_save_path any time you start a PHP session. It’s done like this:

session_save_path ("/home/users/web/<bucket>/<your_homedir>/cgi-bin/tmp");
session_start();

Build your 100-word writing habit with my free email course. Click here to sign up »

Where <bucket> and <your_homedir> are your FatCow “bucket” (?) and “home directory” (mine was moo.<my_username>). You will have to contact FatCow directly to find those out if they are your host. PHPSurveyor uses sessions, and the developer clued me in that my problem sounded like an improper session setup. I initially tried to change it globally using an .htaccess file. That would be a document in my root directory, named “.htaccess” with this code in it:

php_value session.save_path "/home/users/web/<bucket>/<your_homedir"

But that didn’t work. I got internal server errors. So, I went into the “index.php” of my PHPSurveyor setup and inserted:

session_save_path ("/home/users/web/<bucket>/<your_homedir>/cgi-bin/tmp");

Just before the session_start(); at the start of the document (right below the comments) and everything worked fine.

Hopefully this will save someone some headaches.

100-Word Writing Habit is my free email course to help you build a writing habit »

This post is filed under Technology.