Warning: session_start(): failed: Permission denied (13)

php, session

Solution

use `session_save_path()` on page starting

refer : http://php.net/manual/en/function.session-save-path.php

Problem

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) ```

Original source

Related problems