session_start(): Session data file is not created by your uid

前端 未结 9 512
半阙折子戏
半阙折子戏 2020-12-18 05:56

I want to store the created sessions in a directory above the root, except when I use any of the following:

    session_save_path($_SERVER[\'DOCUMENT_ROOT\']         


        
相关标签:
9条回答
  • 2020-12-18 06:18

    Editing config/config.yml and replacing save_path:

    session:
        save_path: '/tmp'
    
    0 讨论(0)
  • 2020-12-18 06:19

    I could be that your Session file was created by another user (well UID), try (re)moving the session file(s) from your temp dir something like /var/tmp

    0 讨论(0)
  • 2020-12-18 06:19

    For lampp users,
    - go to /opt/lampp/temp/
    - delete session file, and test again

    After testing again,
    If error message "Wrong permissions on configuration file, should not be world writable!" shows,
    Run the following at terminal:
    sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

    That worked for me ...

    0 讨论(0)
  • On Ubuntu within Windows 10 , my php user is the default user I create for the first install, I dont know why because the etc/apache2/envvars is not configured like that.

    Nevermind, I change it for fix it quickly and now, it works.

    export APACHE_RUN_USER=rudak
    export APACHE_RUN_GROUP=rudak
    
    0 讨论(0)
  • 2020-12-18 06:25

    What worked for me, could work for you as well.

    It looks like something went wrong with the session. Open the browser's DevTools and delete all Sessioncookies.

    0 讨论(0)
  • 2020-12-18 06:32

    PHP requires session file to be owned by the user running PHP.

    Then just run chown -R www-data:www-data /var/www/storage/sessions/ to own session folder and files by your PHP user (www-data:www-data are your PHP user and group separated by :).

    You can use PHP method get_current_user() or run in bash php -i | grep user and find your user running PHP there.

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