Reputation: 304
I am getting the error:
Warning: Unknown: open(/tmp/sess_beaac196b5082a77131f957bcfa35ee7, O_RDWR) failed: Permission denied (13) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
I have checked the /tmp directory and it is writable (using this code):
$filename = '/tmp';
if (is_writable($filename)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
The php.ini file says session.save_path is /tmp
Is there something obvious I'm missing?
EDIT: I have tried setting a new session path but even after CHMOD 777 it gives me a tells me:
Warning: session_start(): open(/sessions/sess_beaac196b5082a77131f957bcfa35ee7, O_RDWR) failed: No such file or directory (2)
Upvotes: 3
Views: 16400
Reputation: 304
I eventually managed to get it working by putting the full path of my new folder in..
session_save_path('/home/scittwebhost/sessions');
I still do not know why I couldn't write to /tmp
- the permissions were 777
Thanks all
Upvotes: 1
Reputation: 293
use session_save_path()
on page starting
refer : http://php.net/manual/en/function.session-save-path.php
Upvotes: 5