PHP write outside document root

后端 未结 2 2074
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 12:57

I\'m trying to create a file in a directory outside the document root of the web server. The folder has permissions 777 but php says Permission Denied: Warning: fopen(/home/site

2条回答
  •  花落未央
    2021-01-24 13:48

    The 777 permissions is half the battle. You will also need to change the group to be www-data (if on debian) using the:

    chgrp g+w www-data /home/growtent/public_html/images

    That "should" work, depending on what system you are running and given that my memory is correct.

提交回复
热议问题