Removing X-Powered-By

后端 未结 8 2296
温柔的废话
温柔的废话 2020-12-02 05:11
  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

相关标签:
8条回答
  • 2020-12-02 06:13

    This solution worked for me :)

    Please add below line in the script and check.

    Ngnix / Apache etc level settings might not be required.

    header("Server:");
    
    0 讨论(0)
  • 2020-12-02 06:15

    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.

    0 讨论(0)
提交回复
热议问题