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

前端 未结 9 516
半阙折子戏
半阙折子戏 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:36

    this works for me:

    sudo chown -R www-data:www-data /var/lib/php/sessions 
    
    0 讨论(0)
  • 2020-12-18 06:42

    I use this to also make Named Pipes in php.

    <?php
    $user = get_current_user();   // get current process user
    
    // We need to modify the permissions so users can write to it
    
    exec( "chown -R {$user}:{$user} $fifoPath" );    
    
    0 讨论(0)
  • 2020-12-18 06:42

    Another solution: rename your session folder var/session to var/session_old

    create a new folder var/session

    and delete the old one.

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