Removing X-Powered-By(删除 X-Powered-By)
问题描述
如何在 PHP 中删除 X-Powered-By 标头?我在 Apache 服务器上,我使用 php 5.21.我不能在 php 中使用 header_remove 函数,因为 5.21 不支持它.我使用了 Header unset X-Powered-By,它在我的本地机器上运行,但在我的生产服务器上运行.
如果php不支持ver
我认为这是由 expose_php 设置控制的/ini.core.php" rel="noreferrer">PHP.ini:
expose_php = 关闭
<块引用>
决定 PHP 是否可以公开它安装在服务器上的事实(例如,通过将其签名添加到 Web 服务器标头).它在任何方面都不是安全威胁,但它可以确定您是否在服务器上使用 PHP.
没有直接的安全风险,但正如 David C 指出的那样,暴露过时(并且可能易受攻击)的 PHP 版本可能会诱使人们尝试攻击它.
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.
If php doesn't support header_remove() for ver < 5.3, is there an alternative?
I think that is controlled by the expose_php
setting in PHP.ini:
expose_php = off
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.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:删除 X-Powered-By


基础教程推荐
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01