How to hide the PHP version from a Linux server

Source: Internet
Author: User
Typically, one of the Web servers that are installed with the default settings is information disclosure, which is PHP. PHP is now a popular service-side HTML embedded language (one?). )。 In today's challenging era, there are a number of attackers who try to discover vulnerabilities on your server. Therefore, I will briefly describe how to hide php information in a Linux server. By default, expose_php is on by default. Turning off the "expose_php" parameter allows PHP to hide its version information. [ROOT@CENTOS66 ~] #vi/etc/php.ini in your php.ini, locate the row containing the expose_php to set the on off:expose_php = off before the Web server header looks like this: [ ROOT@CENTOS66 ~] #curl-I http://www.ehowstuff.com/HTTP/1.1-okserver:nginxcontent-type:text/html; charset=utf-8vary:accept-encodingx-powered-byhp/5.3.3x-pingback:http://www.ehowstuff.com/xmlrpc.phpdate:wed, 11 Feb2015 14:10:43 gmtx-page-speed:1.9.32.2-4321cache-control:max-age=0, after No-cache change and restart the Web service, PHP will not display the version in the Web Service header: http/1.1 okserver:nginxcontent-type:text/html; charset=utf-8vary:accept-encodingx-powered-byhp/5.3.3x-pingback:http://www.ehowstuff.com/xmlrpc.phpdate:wed, 11 Feb2015 14:10:43 gmtx-page-speed:1.9.32.2-4321cache-control:max-age=0, NO-CACHELCTT: In addition to the PHP version, the WEB server also defaults to the release number. If using Apache server, please refer to this article to turn off Apache version display, if using Nginx server, please add server_tokens off in the HTTP segment; Configuration. Please remember to restart the relevant services for the above changes. Free Pick UpLamp Brother even original PHP tutorial CD/"Detailed PHP" Essentials Edition, details of the website customer service: Http://www.lampbrother.netPHPCMS two times development http://yun.itxdl.cn/online/phpcms/ index.php?u=5 Development of HTTP://YUN.ITXDL.CN/ONLINE/WEIXIN/INDEX.PHP?U=5 Mobile Internet server-side development http://yun.itxdl.cn/online/server/ Index.php?u=5javascript Course Http://yun.itxdl.cn/online/js/index.php?u=5CTO Training Camp http://yun.itxdl.cn/online/cto/ Index.php?u=5
  • 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.