Search code examples
phpsessionpermissions

How can I fix the Permission error when I call session_start()?


when I uploaded the script to the server I got this error

Warning: Unknown: open(/tmp/sess_58f54ee6a828f04116c2ed97664497b2, 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

The error appeared when I call session_start(), although I set the permission of /tmp folder to 777.


Solution

  • Change session path where you can write data or contact server administrator about /tmp problem

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