如何设置PHP的expose_php = Off? [英] How to set PHP expose_php=Off?

查看:682
本文介绍了如何设置PHP的expose_php = Off?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我的应用中删除 X-Powered-By HTTP标头,但我不想使用 x 技术支持 ,因为我可以访问php.ini,因此只需在php.ini中设置 expose_php = Off 即可.

I'm trying to remove the X-Powered-By HTTP header from my app but I don't want to use header_remove('x-powered-by') in my code, because I could just set expose_php=Off in php.ini if I had access to it.

使用.user.ini文件不会执行此操作,因为PHP表示Exposure_php仅是php.ini(是的,我尝试过:/).

Using an .user.ini file won't do it, since PHP says expose_php is php.ini only (and yep, I tried it :/).

有人知道我在这里想念什么吗?

Does anyone know what I'm missing here?

非常感谢!

推荐答案

X-powered-By通过HTTP标头显示网站的语言和版本信息.要屏蔽此信息,您可以参考以下内容 代码.

X-powered-By HTTP header displays language and version information of a website. To block this information, you may refer to the below code.

<system.webServer>
  <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
      </customHeaders>
  </httpProtocol>
</system.webServer>

.

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here.


这篇关于如何设置PHP的expose_php = Off?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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