【发布时间】:2015-02-01 07:12:01
【问题描述】:
我正在尝试写入文件,但 PHP 告诉我这是被禁止的。
我尝试更改权限,将文件分配给组“apache”(根据<?php echo whoami(); ?>),但没有成功。
这是我的文件的结果:
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)
}
你能帮帮我吗?
【问题讨论】:
标签: php linux apache file-permissions permission-denied