Home  >  Article  >  Backend Development  >  怎么关闭php的X-Powered-By信息?

怎么关闭php的X-Powered-By信息?

PHPz
PHPzOriginal
2016-06-13 12:01:354293browse

怎么关闭php的X-Powered-By信息?

关闭php X-Powered-By信息的方法:

网站出错时,在文件头会显示PHP的版本,为了安全起见,我们可以关闭这个PHP版本的信息(X-Powered-By)

1.jpg

关闭方法:

修改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 security

threat in any way, but it makes it possible to determine whether you use PHP

on your server or not.

决定服务器上是否暴露安装有PHP,

(例如:把这些信息加到Web服务器头响应)。这是不安全的。

但能确定你的服务器时候运行着PHP。

意思就是打开的话可以告诉其他人这台服务器可以运行PHP,但不一定安全,可以关掉。

更多相关知识,请访问 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