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();

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.

Thinking of
writing a book?

How to Write a Book cover
Download your FREE copy of How to Write a Book »

(for a limited time)

This post is filed under Technology.