Php fopen()无法打开流:中的权限被拒绝
我试图写入文件,但PHP告诉我这是禁止的 我试图更改权限,将文件分配给组“apache”(根据Php fopen()无法打开流:中的权限被拒绝,php,linux,apache,file-permissions,permission-denied,Php,Linux,Apache,File Permissions,Permission Denied,我试图写入文件,但PHP告诉我这是禁止的 我试图更改权限,将文件分配给组“apache”(根据),但没有成功 以下是我的文件的结果: phpversion: 5.4.16 uname: Linux exists // echo file_exists($file) ? ' exists' : ' does not exist', "\n"; is readable // echo is_readable($file) ? ' is readable' : ' is NOT readable',
),但没有成功
以下是我的文件的结果:
phpversion: 5.4.16
uname: Linux
exists // echo file_exists($file) ? ' exists' : ' does not exist', "\n";
is readable // echo is_readable($file) ? ' is readable' : ' is NOT readable', "\n";
is NOT writable // echo is_writable($file) ? ' is writable' : ' is NOT writable', "\n";
Warning: fopen(system/cache/cache.currency.1417623063): failed to open stream: Permission denied in /var/www/html/test/test.php on line 23
last error: array(4) {
["type"]=>
int(2)
["message"]=>
string(87) "fopen(system/cache/cache.currency.1417623063): failed to open stream: Permission denied"
["file"]=>
string(30) "/var/www/html/test/test.php"
["line"]=>
int(23)
}
您能帮我吗?您设置了哪种fopen模式?读取文件enough
fopen(“/var/www/html/test/test.php”,“r”)代码>这是SELinux。它阻止了所有的文件更改,所以我可以读,但不能写