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'] . '/../storage/sessions');
session_save_path($_SERVER['DOCUMENT_ROOT'] . '/../storage/sessions/'); // With an extra slash at the end
ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'] . '/../storage/sessions');
ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'] . '/../storage/sessions/'); // Again with the extra slash
and not one of these methods work, whenever I load the page I get the following errors:
Warning: session_start(): Session data file is not created by your uid
in /var/www/bootstrap/bootstrap.php on line 25
Warning: session_start(): Failed to read session data: files (path:
/var/www/public/../storage/sessions/) in
/var/www/bootstrap/bootstrap.php on line 25
Can anyone help me?
Edit: My server runs on PHP 7.1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…