How do I configure PHP to have permission to create directories and make files?

前端 未结 3 339
你的背包
你的背包 2021-01-14 21:10

I have a PHP script that receives uploads and it works fine in mamp, creating directories and receiving files as necessary, but when I move it to the server it errors out sa

相关标签:
3条回答
  • 2021-01-14 21:42

    The script must be able to write to the parent directory in order to create sub directories, so chmod 777 the parent directory, for instance httpdocs/uploads/ or wherever you are storing these files.

    0 讨论(0)
  • 2021-01-14 21:51

    chown or chmod 777 the directories where the script wants to write (create) the files and NOT the script itself.

    0 讨论(0)
  • 2021-01-14 22:01
    chmod("/somedir/somefile", 0777);
    
    0 讨论(0)
提交回复
热议问题