Dan*_*iel 5 php permissions session
我正在尝试初始化会话但是我收到此错误:
警告:session_start()[function.session-start]:open(/ tmp/sess_7af3ee9ec1350680bedcf63833d160bd,O_RDWR)失败:权限被拒绝(13)
session.path设置为/ tmp,带有777 perms.
我尝试将session.path编辑为"0; 777;/tmp",但会话文件是使用错误的权限创建的(仅写入).
我在apache2和ubuntu 9.10上使用PHP 5.2.有任何想法吗?
请验证/tmp的权限确实是xx777
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$s = stat('/tmp');
printf('%o', $s[2]);
file_put_contents('/tmp/phptest1234.txt', 'test');
unlink('/tmp/phptest1234.txt');
Run Code Online (Sandbox Code Playgroud)
编辑:下一次尝试,umask
<?php
echo ' php-umask: ', sprintf('%o', umask()), "\n";
echo ' exec-umask: ', exec('umask'), "\n";
Run Code Online (Sandbox Code Playgroud)