I recently setup the free/open source version of SugarCRM to manage some of my business contacts in the gaming industry. I went with a web based solution so I could open up portions of the data to my staff. After selecting SugarCRM as my tool of choice, I setup space for it and got to the installation portion. On step 2 of the installation, I got a nasty message

Writable Session Save Path (/tmp) Not A Valid Directory

I started doing a little research and realized it was the php configuration value for the session.save_path variable. My webshost runs phpsuexec, which is related to security and resource usage and is really out of the scope of this conversation. What that means is that you have to override php.ini configuration values through a php.ini file and not through .htaccess. Using the htaccess method results in a wonderful 500 error message.

Resolving the issue, which I figured would take 5 minutes, was actually a rather frustrating process. In theory, I should have been able to slap a php.ini file in this new directory with the following line:

session.save_path = /tmp

That didn’t seem to work. After trying variations of paths for the save_path I realized that the wonderful installer was also telling me that the version of PHP I was running, 5.x, was an untested version. I run PHP 5 for it’s OO/class support and it was apparently cascading down to this new directory. I went ahead and changed my .htaccess file to use PHP 4.x instead. To do this, add the following line to your .htaccess file:

AddHandler application/x-httpd-php .php

instead of the following, which utilizes PHP 5 on my webspace:

AddHandler application/x-httpd-php5 .php

Once I did that, I started to make a little progress, but it wasn’t until I happened upon a posting about the session.save_path value that I got things working. Apparently using absolute paths isn’t necessary and simply changing the value in your php.ini to the following resolved my problems and allowed me to get past the second step of my installation:

session.save_path = tmp

So there you have it, if your install is throwing the above error, just update your files to include these values and get to using SugarCRM.

.htaccess
AddHandler application/x-httpd-php .php
php.ini
session.save_path = tmp