Home  >  Article  >  Backend Development  >  问个小白的问题

问个小白的问题

WBOY
WBOYOriginal
2016-06-23 14:26:42827browse

浏览器访问服务器上的配置文件,比如config.php。该文件没有任何输出,也根本看不到源码,那为什么服务器还需要配置禁止直接访问该配置文件呢,有没人解释下?还是我太小白了!


回复讨论(解决方案)

从浏览器看不到源码,但可以使用其他方法看到源码和你的配置内容,所以安全起见需要禁止访问配置文件。

安全需要,毕竟有些功力稍微深厚些的人还是可以通过其他漏洞来看到文件代码的...

谁也不能保证程序百分百没有漏洞,那些大牛就能通过你项目的漏洞来获取到config的信息。

别人直接下载你的config.php文件,你的配置就暴露。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn