PHP Session File Stored in Temp Directory - Apache

5,515

Sounds like you are just having permissions issues - instead of going the .htaccess route as the last question/answer suggested - find the session save path in your php.ini, & set it to some path that is NOT in a user directory [ /tmp ??] - make sure that directory has write permissions by whatever the webserver is running as .... be sure to stop/start apache.

Share:
5,515

Related videos on Youtube

navalhawkeye
Author by

navalhawkeye

Updated on September 18, 2022

Comments

  • navalhawkeye
    navalhawkeye over 1 year

    I am having a slight problem...I have a server that I set up using AppServ 2.5.10, running Apache 2.2.8 and PHP 5.2.6. This is running on Windows Server 2008R2.

    The problem is in order for the sessions to work, I have to be logged into the server. Meaning, my user on the server has to be logged in and I have to have an active session (logged into) on the site. If one of those is not true, the website gives the following error on any page that has session_start()

    Warning: session_start() [function.session-start]: open(C:/Users/MARKR_~1/AppData/Local/Temp/2\sess_a35eddd147642009ba2e4f2364aaacff, O_RDWR) failed: No such file or directory (2) in C:\AppServ\www\ITOPS\Contacts\admin\add\addContact.php on line 2

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\ITOPS\Contacts\admin\add\addContact.php:2) in C:\AppServ\www\ITOPS\Contacts\admin\add\addContact.php on line 2

    Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\ITOPS\Contacts\admin\add\addContact.php:2) in C:\AppServ\www\ITOPS\Contacts\admin\add\addContact.php on line 4

    I tried doing what was suggested in this post:

    Store session files in different directories in PHP

    But I couldn't get it to create a session file in the directory I specified, so it gave the same error.

    I have the same setup, except running Server 2003, and this problem doesn't exist. It was installed the same way and same version of Apache/PHP.

    Any ideas as to what I'm doing wrong?

  • Sean Kimball
    Sean Kimball over 12 years
    Your welcome. Glad to help.