Session_start failing because lack of permissions
I'm using Windows 7 with an Administrator account. I have Xampp installed at C:\xampp.
I have the same problem that this situation, and I tried:
- Uncheck "read only" boxes to all files and folders
- attrib -r -a C:\xampp\tmp /S /D (without the /D gives file not found)
- Selected "eve开发者_开发百科ryone" in security just to make sure.
My xampp and tmp folder are now probably the unsafest folder in my computer, but I still get
Warning: session_start() [function.session-start]: open(\xampp\tmp\sess_1fcpeje5cqaopevmlclif9ejc0, O_RDWR) failed: No such file or directory (2)
Which I think it means that the folder is still not writable. My code is just as
<?php
session_start();
....
>
Now, you can do follow some step:
- Stop apache
- Go to php.ini file
- press Ctrl + f then type "session.save_path" into Find Watch textbox.
- You can set value to your tmp folder. for example : "D:\xampp\tmp".
- Now you can re start your apache.
Good luck
- If you're using a 64 bit system, I highly recommend installing wamp 64 bit.
- If you want to stick to XAMPP try the following:
- use the function ini_set to set the path to the sessions to be saved.
- a path that works is c:\windows\temp
If all failed try install your wamp or xamp on d drive or any other drive but c. this will guarantee permission on normal drives.
精彩评论