Giving PHP write permission in Apache

前端 未结 5 792
Happy的楠姐
Happy的楠姐 2020-12-17 04:07

I\'m relatively new to configuring Apache.

I have a PHP script that writes a JSON file based on values retrieved from $_GET.



        
5条回答
  •  爱一瞬间的悲伤
    2020-12-17 04:30

    You need to check if the user under which runs apache has permission to write into the directory.

    So it's like this:

    Your apache server is process. The process runs under some user (say www). The PHP runs under apache. So if you try to write into a directory in PHP it is the same as if the user www logs into the server and tries to create a file in the same directory. So check who is owner of that directory and which permission do it have. You can do it e.g. via ls -la command. If www will be owner of that directory, you will be 100% safe ...

提交回复
热议问题