简体   繁体   English

move_uploaded_file 无法打开流:权限被拒绝 Mac

[英]move_uploaded_file failed to open stream: Permission denied Mac

I want to upload an image.我想上传一张图片。 Every time I try to upload the image I recieve the error message found below.每次我尝试上传图像时,我都会收到下面的错误消息。

I have already set the permissions to read&write:我已经设置了读写权限:

Warning: move_uploaded_file(uploads/1000020170620022532img3.png): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/social-network-master/profile.php on line 41警告:move_uploaded_file(uploads/1000020170620022532img3.png):无法打开流:第 41 行的 /Applications/XAMPP/xamppfiles/htdocs/social-network-master/profile.php 中的权限被拒绝

Warning: move_uploaded_file(): Unable to move '/Applications/XAMPP/xamppfiles/temp/phpYqSkvp' to 'uploads/1000020170620022532img3.png' in /Applications/XAMPP/xamppfiles/htdocs/social-network-master/profile.php on line 41警告:move_uploaded_file():无法将“/Applications/XAMPP/xamppfiles/temp/phpYqSkvp”移动到“uploads/1000020170620022532img3.png”在/Applications/XAMPP/xamppfiles/htdocs/social.phpnetwork-line-profile 41

Friend, You only need only to create the directory where are your .php file is found:朋友,您只需要创建您的 .php 文件所在的目录:

uploads/上传/

And change the Only write in the folder并更改只在文件夹中写入

Please use below code:请使用以下代码:

move_uploaded_file($_FILES['image']['tmp_name'],'uploads/1000020170620022532img3.png');

If this code is not working please check path and folder permission.如果此代码不起作用,请检查路径和文件夹权限。

try this in terminal在终端试试这个

sudo chmod -R 777 upload/

ps got to the upload directory and run sudo chmode -R 777 directly. ps 进入上传目录并直接运行sudo chmode -R 777

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 move_uploaded_file 无法打开 stream:权限被拒绝 - Mac - move_uploaded_file failed to open stream: Permission denied - Mac move_uploaded_file无法打开流和权限被拒绝错误 - move_uploaded_file failed to open stream and Permission denied error move_uploaded_file给出:无法打开流:权限被拒绝 - move_uploaded_file gives: failed to open stream: Permission denied move_uploaded_file(…):无法打开流:权限在…中使用Mac OS X Mountain Lion - move_uploaded_file(…): failed to open stream: Permission denied in… Using Mac OS X Mountain Lion move_uploaded_file(uploads /)[function.move-uploaded-file]:无法打开流:权限被拒绝 - move_uploaded_file(uploads/) [function.move-uploaded-file]: failed to open stream: Permission denied PHP警告:move_uploaded_file():无法移动/无法打开流:权限被拒绝 - PHP Warning: move_uploaded_file(): Unable to move/failed to open stream: Permission denied php 文件上传错误警告 move_uploaded_file 无法打开 stream 权限被拒绝 - php file upload error warning move_uploaded_file failed to open stream permission denied in 上传文件警告:move_uploaded_file(../ view / pictureswhy.PNG):无法打开流:权限被拒绝 - Upload file Warning: move_uploaded_file(../view/pictureswhy.PNG): failed to open stream: Permission denied 警告:move_uploaded_file无法打开流:权限被拒绝的PHP文件 - Warning: move_uploaded_file failed to open stream: Permission denied PHP file Laravel中出现“ move_uploaded_file():无法打开流:权限被拒绝”错误 - Getting “move_uploaded_file(): failed to open stream: Permission denied” error in Laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM