Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/245.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php fopen()无法打开流:中的权限被拒绝_Php_Linux_Apache_File Permissions_Permission Denied - Fatal编程技术网

Php fopen()无法打开流:中的权限被拒绝

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',

我试图写入文件,但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', "\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。它阻止了所有的文件更改,所以我可以读,但不能写