Skip to content

User Tutorials icon

How to Resolve Session Save Path Errors

This tutorial deals with "session save path" warning messages that you may encounter in setting up your Mambo CMS website.

session save path Unwriteable
orsession save path Not Set

Session.save_path is a PHP directive which needs to be set in your PHP configuration settings (the php.ini file). It is unusual to encounter problems with this in a shared hosting environment as it is a standard PHP setting that most hosts enable. However, sometimes hosts don't set it correctly.

If you have set up your own server, you will need to edit your php.ini file to enable PHP sessions.

Please Note: this is NOT a Mambo issue. PHP is designed to handle sessions and almost every dynamic script requires the use of sessions.

To check if session.save_path is set on your web server space, create a file with a text editor, calling it info.php (you can call it anything you like as long as you create the file with the .php extension).
In the file, put this one line of code:

<?php phpinfo(); ?>

Upload the file to your site, then call it in your web browser, eg. http://yourdomain.com/info.php

Look for the entry that says: session.save_path = path/to/sessions/file
If there is no file entered, then you do not have a session.save_path set up. If there is a file entered, check that it exists and is writeable.

If you are using a hosted account for your web site and there is no session.save_path entered, or it is not writeable - contact your host and ask them to change this.

Sometimes, the sessions file is writeable, but the file ownership is not set for it to be writeable by Mambo. Again, this is a matter for your host.

What happens if my host won't help?

  • Consider changing hosts (you pay them for their service after all!)
  • Or try .htaccess

.htaccess workaround:
This will work in the following situations:

  • PHP is run as a module under Apache (mod_php)
  • Your host has allowed .htaccess overrides (if you already successfully use an .htaccess file, then your server space most likely meets both these requirements)

It won't work in these situations:

  • You are running PHP under CGI (eg. suexec)
  • You are running your site on a Windows server or IIS

Either open an .htaccess file you already have in the public html of your site and enter this directive, or create an .htaccess file with your text editor and upload it to your public http space:

php_value session.save_path '/path/to/a/writeable/folder'

If you do not already have a sessions folder to use, create one and make sure the path is correct.

Important!
Because the sessions folder accumulates all kinds of information about your site, it should NOT be placed within any public area of your web space. For your site's security, it should be created outside the public_html or www area, in the root of your server space, not your web root.

Changing php.ini yourself:
The format to use in your php.ini file is as follows:
session.save_path = w:/tmp

Windows users may need to change this to:
session.save_path = w:\tmp (usually the forward slash delimiter works just fine).

Summary:
Session.save_path is a PHP directive which needs to set by your hosting company. If you get messages on installing Mambo, that say that session save path is not set or is unwriteable, you should really contact your host and alert them to the problem.

Bookmark This:
  • bodytext
  • Technorati
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Reddit

Whether I am developing Mambo or working on tutorials I am fuelled by coffee. Caffeine keeps me going so if you like the work I am doing please click on the cup to buy me a coffee today. Just $10 covers the cost of getting my caramel macchiato ;)

If you enjoyed this article make sure you subscribe to my RSS feed!

Leave a Reply

This is a gravatar-friendly site, enter your email address to use your gravatar.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.