GoDaddy Support

Warning: Unknown: Failed to write session data (files)

Date Submitted: 9-6-2011 by bcolbert

Not what you're looking for?
We want your feedback!

I ran into this problem and spent HOURS trying to figure it out. I read a lot of articles about removing line breaks and spaces from .php files. This didn’t fix my problem.

Instead I looked at phpinfo.php on my hosting site (using WordPress). It showed that session.save_path was not set. (I had just moved my hosting to 4GH when all these problems showed up)

I found an article that suggested that I:

replace session_start(); with
session_save_path(“/tmp”); session_start();

This worked! All errors went away immediately.

I think GoDaddy needs to set the php5.ini file so that session.save_path is set as a variable. Since php finds that this variable is not set, php throws a bunch of errors.

Try it. I bet it’ll solve your problem also.

11 Comments on "Warning: Unknown: Failed to write session data (files)"

  • by bfountain428 on October 3rd, 2011

    Your awesome!!! I have been fighting the same issue for 6hours now…Thanks a million!!!

  • by webmio on October 9th, 2011

    I literally spent HOURS trying to fix this issue…and your solution solved the problem. I hope your post came up earlier in my quest for solutions :)

    This happened when I switched from Windows to Linux server…and it seems that this problem does not happen with the Linux SHARED hosting…

  • by minaus on October 21st, 2011

    Thanks a lot!!!!!!!!!!!

  • by jimthewebguy on October 27th, 2011

    FOR ME:
    SMF Forum stopped allowing posts from users and the Admin section was not accessible. Got errors like:
    ————————–
    “Session verification failed. Please try logging out and back in again, and then try again.”
    ————————–
    -AND-
    ————————–
    “Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0″
    ————————–

    Solution for me was to add a folder named “tmp” in the root website folder, and add the following line to my “php5.ini” that I also had in the root folder of the site:

    session.save_path = “/tmp/”

    SMF Forum immediately started working again.

  • by somnius on November 14th, 2011

    Hi there! Thanks for the tip! This lead me into a better solution yet. You can modify the php5.ini file in the root directory by adding the line:

    session.save_path = /tmp

    This line does exactly the same thing as the function above, with the advantage of not having to modify each and every page where Session is used. You just modify one. Remember to upload the php5.ini file again after modifying!

    Also, make sure your text editor does not modify the original Carriage Return characters on the php5.ini file. You might want to use an editor other than Notepad for that, such as Notepad++.

    Cheers!

  • by lotus_com on December 5th, 2011

    Hello,
    session works well, but it displays this error message :
    “Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home/content/89/8611889/html/admin/article.php:1) in…”

    I try with “session_save_path(“/tmp”); but no change.

  • by bitvoy on February 7th, 2012

    Thanks for this post. I had also just moved my hosting to 4GH. It did take some fiddling for me to get your solution to work. I had to:
    1. Go to the directory where the php page that was throwing the error was located and create a directory named “tmp”.
    2. Open the php file that throws the error (in my case it was page-contact.php) and locate the line containing session_start();. Replace it with
    session_save_path('/tmp');
    session_start();

    3. Upload the changed file to the server.

    The key here was that in my file editor I have to use ‘/tmp’ instead of “/tmp”. Just FYI for others out there.

  • by jaganryali on February 27th, 2012

    adding session.save_path doesn’t help me in removing those errors.
    But adding a method before session_start works well.

  • by unurgent on March 19th, 2012

    thank you bitvoy your advice worked for me

  • by hitowerinc on March 24th, 2012

    Thank you bitvoy, I spent hours trying to figure this out and your method worked.

  • by angelfire on March 26th, 2012

    Thanks to bitvoy, your answer for this problems. God bless you.

NEED HELP? Call our award-winning support team 24/7 at (480) 505-8877
Submit

United States - English
Traffic Log Image