• Skip to primary navigation
  • Skip to main content
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to hide php version information in header

September 30, 2013 by Sharad Chhetri Leave a Comment

While migrating from godaddy account to new server which is hosted in DigitalOcean,I checked the header by using command curl -I https://sharadchhetri.com .
In output of command ,I found PHP version was given.For security point of view I want to hide or disable this information.

For this you have to do small change in php.ini file.Because it is CentOS hence the path is /etc/php.ini

Step 1: First take the backup copy of file php.ini

cp -p /etc/php.ini /etc/php.ini.orig

Step 2: Now edit the php.ini and search for keyword expose_php and make it off
I use vi or vim editor.You can select your favorite editor

vi  /etc/php.ini

expose_php = off

Step 3: Now restart the apache web server

/etc/init.d/httpd restart

Step 4: Now check your website.the PHP version info will not be there

curl -I http://your-website-url

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Hide and disable URL field in comment form in WordPress [ Plugin ]
  2. How to change login banner message in GUI mode in CentOS 6 or above version.
  3. Show visitor ip address php code
  4. How to clear apc cache by using php script
  5. Install and upgrade to latest Git version on Ubuntu/Debian/Linux Mint
  6. How to find CentOS Linux release version on CentOS 7 series
  7. How to install Varnish 4 version on CentOS 7 / RHEL 7
  8. Increase upload file size limit in php
  9. php 5.5 APC : ERROR: `make’ failed
  10. PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

Filed Under: Tips And Tricks Tagged With: apache, php

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy