How to Fix: Warning: session_start() [function.session-start]: open(/tmp/sess_…O_RDWR) failed.

So, you’ve just installed or moved your PHP Melody installation to a new server and you’re greeted with this message:

Warning: session_start() [function.session-start]: open(/tmp/sess_e0725de9954b..2c14904, O_RDWR) failed: Permission denied (13) in /home/melody/public_html/stuff.php on line 42

This error basically indicates that the server’s PHP installation is not really configured that well. Note: We’re not referring to the PHP Melody installation, but the actual PHP runtime.

As a result, the first thing you should do is report this error to your hosting provider. They should have a ‘live chat’ available for such things and you could solve this problem in a matter of minutes.

If for some reason you don’t or can’t report the problem to someone who will address it, you may be able to solve this problem yourself.

How to change the sessions folder

Most hosting providers will allow you to either create your custom php.ini file or modify an existing php.ini file via your cPanel or Plesk account.

See if your hosting provider allows you to update your “PHP Configuration” from your account management panel (cPanel, Plesk, etc.).

Once you’ve found your PHP configuration file (php.ini), search for the following line:

session.save_path =

If you don’t have root access to the server in order to set the correct permissions to the /tmp folder, create a new folder which you can control and use it as the default folder for your PHP session files.

For example, if your hosting’s account path is:

/home/videos34/public_html/

Create a new folder for your sessions (outside the public_html folder would be best) as such:

/home/videos34/tmp/

Next, change the permissions for your tmp folder to 0777 (fully writable).
Now you can specify this new folder in your php.ini as such:

session.save_path = '/home/videos34/tmp/'