关闭php X-Powered-By信息的方法:
网站出错时,在文件头会显示PHP的版本,为了安全起见,我们可以关闭这个PHP版本的信息(X-Powered-By)
关闭方法:
立即学习“PHP免费学习笔记(深入)”;
修改php.ini 文件
设置expose_php = Off即可。
说明:
X-Powered-By会显示PHP版本信息,会暴露服务器运行的是php。
官方给出的说明
Decides whether PHP may expose the fact that it is installed on the server(e.g. by adding its signature to the Web server header). It is no securitythreat in any way, but it makes it possible to determine whether you use PHPon your server or not.
决定服务器上是否暴露安装有PHP,
(例如:把这些信息加到Web服务器头响应)。这是不安全的。
但能确定你的服务器时候运行着PHP。
意思就是打开的话可以告诉其他人这台服务器可以运行PHP,但不一定安全,可以关掉。
更多相关知识,请访问 PHP中文网!!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号