How do you permit PHP to write to a file without compromising server security

后端 未结 2 1831
长发绾君心
长发绾君心 2021-01-19 01:32

I am often confronted with negative comments whenever I want to have a PHP script write output to a file on the server.

I use the fopen(), fwrite(

2条回答
  •  庸人自扰
    2021-01-19 02:03

    The risk is if that writable directory resides in an area accessible to the outside world. Then those with the right tools and know how can write anything they want to that directory... or file. They can then place malware in it or create a phishing scheme on your site.

    Really they can do all kinds of things to compromise you. I have seen this on my own servers and haven't really found the right solution to this.

提交回复
热议问题