请帮助图片无法在服务器上传,我的 php代码: -
$gallery_image = $_FILES['image'] ['name'];
$image_tmp = $_FILES['image'] ['tmp_name'];
move_uploaded_file($image_tmp, "../extra_images/$gallery_image");
我的错误是: -
PHP Warning: move_uploaded_file(../extra_images/brand-04.jpg): failed to open stream: Permission denied in G:\PleskVhosts\luisant.in\vethathirimaharishischool.org\admin\gallery.php on line 129
PHP Warning: move_uploaded_file(): Unable to move 'C:\Windows\Temp\php4118.tmp' to '../extra_images/brand-04.jpg' in G:\PleskVhosts\luisant.in\vethathirimaharishischool.org\admin\gallery.php on line 129
答案 0 :(得分:0)
错误是不言自明的:
failed to open stream: Permission denied on "../extra_images/"
您没有上述目录的写入权限。提供写入权限,然后重试。
答案 1 :(得分:0)
您没有该目录的权限。
更改目标目录的所有者和权限/extra_images
尝试此命令:
chown user /extra_images
chmod 755 /extra_images
答案 2 :(得分:0)
这是因为images和tmp_file_upload只能由root用户写入。要上传到工作,我们需要使这些文件夹的所有者与httpd流程所有者相同或使它们全局可写。learn more>>