删除X-Powered-By [英] Removing X-Powered-By

查看:143
本文介绍了删除X-Powered-By的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 如何在PHP中删除X-Powered-By标头?我在Apache服务器上,我使用PHP 5.21。
    我不能在php中使用header_remove函数,因为5.21不支持它。我使用Header unset X-Powered-By,它在我的本地机器上工作,但不在我的生产服务器上。

  1. How can I remove X-Powered-By header in PHP? I am on an Apache Server and I use php 5.21. I can't use the header_remove function in php as it's not supported by 5.21. I used Header unset X-Powered-By, it worked on my local machine, but not on my production server.

如果php不支持header_remove( )对于ver< 5.3,有替代方案吗?

If php doesn't support header_remove() for ver < 5.3, is there an alternative?


推荐答案

我认为这是由 PHP.ini <中的 expose_php 设置/ a>:

I think that is controlled by the expose_php setting in PHP.ini:

expose_php = off




决定PHP是否可以公开它安装在服务器上的事实(例如,通过将其签名添加到Web服务器头)。它不是任何安全威胁,但它可以确定您是否在服务器上使用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.

没有直接的安全风险,但正如David C所说,暴露过时的(可能是易受攻击的)PHP版本可能是一个邀请人们试图攻击它。

There is no direct security risk, but as David C notes, exposing an outdated (and possibly vulnerable) version of PHP may be an invitation for people to try and attack it.

这篇关于删除X-Powered-By的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆