How to hide the output (X-Powered-By) information of the php header version

Source: Internet
Author: User
How to hide the output (X-Powered-By) information of the php header version
This article describes how to hide the version output x-powered-by of the php header. if you need it, refer to it.

In the php program, the header information is output By default: (Status-Line) HTTP/1.1 200 OKDate Wed, 23 Feb 2011 02:30:46 GMTServer Apache/2.2.13 (Win32) X-Powered-: PHP/5.2.3Content-Length 30Keep-Alive timeout = 5, max = 100 Connection Keep-AliveContent-Type text/html

To avoid outputting the above version information, you can modify the expose_php of php. ini to change the default On to Off.

You can use the following methods to hide and disguise Apache and php headers.

1. add ServerSignature OffServerTokens Prod in Apache http. conf.

Among them, ServerSignature Off tells Apache that the server version information is not displayed on the error page (such as HTTP Status 404), but this option does not affect the pages that can be accessed normally (such as HTTP Status 200 ). The Server Header that normally accesses the webpage still contains the Server version information.

ServerTokens Prod tells Apache to only return Apache in the Server Header information, and does not return the version information of the Server operating system and Apache.

2. hide the php header version php. iniexpose_php = Off. hide the information similar to X-Powered-By: PHP/5.2.4 sent By the PHP program header.

Setting expose_php = Off in the php. ini file can avoid output of version information such as X-Powered-By: PHP/5.2.4.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.