PHP session_start fails

前端 未结 3 1006
心在旅途
心在旅途 2020-12-17 00:31

I\'m trying to start the session in a header page in my webiste. But it seems there might be some sort of bug because it fails with the following error:

Warn         


        
相关标签:
3条回答
  • 2020-12-17 00:53

    This means that you don't have the correct permissions to either read or write the files in the temp directory.

    If you on linux then do this

    sudo chmod -R 755 \xampp\tmp //or should it be 775
    

    On windows do this as an administrator

    attrib -r -a C:\xampp\tmp /S
    
    0 讨论(0)
  • 2020-12-17 00:53

    As Selular88 mentioned, Adding the path works and fix this issue. You can also check the path using

    // This will output your current path.
    echo session_save_path() ;
    
    0 讨论(0)
  • 2020-12-17 01:11

    First stop the Xampp Server.

    session.save_path = "\xampp\tmp"

    and change it to look like this

    session.save_path = "C:\xampp\tmp"

    Restart the Xampp Server.

    That’s it now your session should work as expected.

    0 讨论(0)
提交回复
热议问题