Can a client view server-side PHP source code?

前端 未结 7 1827
小鲜肉
小鲜肉 2020-12-01 23:17

I\'m developing a PHP application that has to respond to request from several clients, and I thinks \"Can any of the clients see the PHP code that I\'m writing?\".

7条回答
  •  感情败类
    2020-12-02 00:06

    No, but you should take all measures to prevent it.

    You should always set your sensitive code (heck, why not all?) in a directory bellow your server working dir (say /www), that way if the server gets messed up, it wont be able to show your code to the world because that code will be included by php that is not working in the first place.

提交回复
热议问题