2013-08-22 02:33
浏览 69

move_uploaded_file(...):无法打开流:权限被拒绝...使用Mac OS X Mountain Lion

So basically I have your classic 'move_uploaded_file' statement:

move_uploaded_file($_FILES['image']['tmp_name'], 'files/' . $_FILES['image']['name']);

But I am getting this on my OS X Mountain Lion:

move_uploaded_file(...): failed to open stream: Permission denied in... 

How can I change the permissions so I can move it?

图片转代码服务由CSDN问答提供 功能建议


  move_uploaded_file($ _ FILES ['image'] ['tmp_name'],'files /'。$ _FILES ['image'] ['name']); 
 < 但是我在我的OS X Mountain Lion上得到了这个: 


  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doumiang2297 2013-08-22 02:35

    in MAC OS X's terminal ,use this commande :

      CHMOD 775 yourFilesPath

    775:Standard file sharing mode for a group.

    解决 无用
    打赏 举报
  • doupai8533 2016-08-28 09:54

    First thing to note down since you are using xamp server which have the Application folder in Root


    so for uploading the image file you have to provide the target directory which should be present in the Root try with the same directory in which application is running

    And then locate the xamp server location by clicking on show original on the mac after right click and then change the permission

    for the images folder and the php file, by going to the file > Right click > Get info > and then change all the permissions to read&write as the following picture.

    enter image description here

    解决 无用
    打赏 举报

相关推荐 更多相似问题