Search code examples
phpsessiontmp

Premission denied to start session - PHP


I have the following error:

Warning: session_start(): open(---temp\sess_u800qhordqngjf1c9mlspmb1c6, O_RDWR) failed: Permission denied (13) in ---login.php on line 2
Warning: Unknown: open(---temp\sess_u800qhordqngjf1c9mlspmb1c6, 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 (---\temp) in Unknown on line 0

instead the path displayed I wrote ---.

This error wasn't displayed until now (I'm on localhost). I tried to find the solution on the web, but I can't figure what exactly should I do...

How can I fix it?

Thanks!


Solution

  • In your php.ini file it is specifying the session.save_path to be ---\temp.

    That means one of the following is your problem:

    1) That path does not exist
    2) That path is not writable

    As a solution, you have three options:

    1) Make the path exist
    2) Make the path writable
    3) Change it to another path