Warning session_start() open() failed: Permission
Posted by: urbanroute
Posted on: 2006-08-15 17:54:00
I see a lot of questions about this error and no answers that worked as well as this one!
Just a note before I go on... If you have a difficult issue that you have overcome.. POST THE SOLUTION for all of us to see! Nothing is worse than searching through a bunch of posts where nothing is resolved because people don't post the information on how they fixed it. Take the time to post useful help for everyone's benefit.
ok..
If you are getting something like this error:
Warning: session_start(): open(/tmp/sess_9ace3e42e3eb00c3ec5df76045e395fd,
O_RDWR) failed: Permission denied
Looks like php is having permission issues trying to write a session value to the session directory, so you first need to make sure you have the correct permissions to write to the session directory normally /tmp. You can try this by simply running session_start(); from a new file you create called test.php page. If you get that error chances are you don't have permissions and the sys admin should be able to correct that for you.
The issue I had was that my script was using "ForceType" where I could dynamically creative pages on the fly. This caused the same error message and nothing the sys admin could do helped, so I think it has something to do with creating php files dynamically using ForceType.
Here is the work around without getting support from the system admin:
1. Create your own temporary directory like:
/home/youraccount/yourwebsite.com/sesstmp
2. chmod it 0777.
3. Then add a .htaccess file to your web sites main directory and add this line:
php_value session.save_path /home/youraccount/yourwebsite.com/sesstmp
That should do it! It worked for me, and I searched for a solution everywhere!
-ry
urbanroute (at) gmail (dat) com