File linux权限移动\上传\文件

File linux权限移动\上传\文件,file,permissions,copy,fedora,File,Permissions,Copy,Fedora,我在linux fedora 18上工作,函数move_上传的文件显示警告: 错误: [Wed Jun 05 18:41:21.731524 2013] [:error] [pid 11502] [client 127.0.0.1:40340] PHP Warning: move_uploaded_file(/var/www/html/estampa/management/include/1.jpg): failed to open stream: Permission denied in /

我在linux fedora 18上工作,函数move_上传的文件显示警告:

错误:

[Wed Jun 05 18:41:21.731524 2013] [:error] [pid 11502] [client 127.0.0.1:40340] PHP Warning:  move_uploaded_file(/var/www/html/estampa/management/include/1.jpg): failed to open stream: Permission denied in /var/www/html/estampa/management/include/sys_content.php on line 31, referer: estampa/management/sistema/?secc=noticias&oper=mod&id=22
[Wed Jun 05 18:41:21.731547 2013] [:error] [pid 11502] [client 127.0.0.1:40340] PHP Warning:  move_uploaded_file(): Unable to move '/tmp/phpH5BLGD' to '/var/www/html/estampa/management/include/1.jpg' in /var/www/html/estampa/management/include/sys_content.php on line 31, referer: estampa/management/sistema/?secc=noticias&oper=mod&id=22
php脚本:

$archivo = $_FILES['imagen']['name'];
if($archivo != ""){
$target_path = "../../../web/images/pub/";
$target_path = dirname(__FILE__)."/";

$target_path = $target_path . basename( $_FILES['imagen']['name']); 
if($error_up = move_uploaded_file($_FILES['imagen']['tmp_name'], $target_path)) { 
$var = "El archivo ". basename( $_FILES['imagen']['name']). " ha sido subido";
} 
else{
$var = "Ha ocurrido un error, trate de nuevo!";
}
}

#ls -lrt |grep include
drwxr-xr-x. 2 apache apache 4096 May 26 15:58 include
# chmod 0777 -R include
# chown apache:apache include


httpd.conf
<Directory "/var/www/html">
    httpd.conf
    Options  -Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
$archivo=$\u文件['imagen']['name'];
如果($archivo!=“”){
$target_path=“../../../web/images/pub/”;
$target_path=dirname(_文件)“/”;
$target_path=$target_path.basename($_文件['imagen']['name']);
如果($error_up=move_upload_file($_FILES['imagen']['tmp_name'],$target_path)){
$var=“El archivo”.basename($_FILES['imagen']['name'])“ha sido subido”;
} 
否则{
$var=“Ha ocurrido un error,trate de nuevo!”;
}
}
#ls-轻轨| grep包括
drwxr-xr-x。2 apache 4096 May 26 15:58包括
#chmod 0777-R包括
#chownapache:apacheinclude
httpd.conf
httpd.conf
选项-索引
不允许超限
命令允许,拒绝
通融
函数copy(),同样的错误


你能帮我吗,请

您很可能有SELinux权限问题。有关详细信息,请参阅。

您很可能存在SELinux权限问题。有关详细信息,请参阅。

最终有效!!感谢asmecher,设置chcon-R-t httpd_sys_rw_content_t文件夹的权限,并查看ls-halZfinally works!!感谢asmecher,设置chcon-R-t httpd_sys_rw_content_t文件夹的权限,并查看ls-halZ