Posted in Apache Linux

Hide PHP version in the header (X-Powered-By)

March 3, 2007 - No comment

Edit /etc/php.ini (under RHEL/CentOS) and set :
expose_php = Off

Before :
$ curl -I www.wains.be
HTTP/1.0 200 OK
Date: Sat, 03 Mar 2007 14:55:17 GMT
Server: Apache
X-Powered-By: PHP/4.x.x
X-Pingback: http://www.wains.be/xmlrpc.php
Content-Type: text/html; charset=UTF-8
X-Cache: MISS from localhost
Connection: close

After :
$ curl -I www.wains.be
HTTP/1.0 200 OK
Date: Sat, 03 Mar 2007 15:11:36 GMT
Server: Apache
X-Pingback: http://www.wains.be/xmlrpc.php
Content-Type: text/html; charset=UTF-8
X-Cache: MISS from localhost
Connection: close

Leave Comment

Please consider visiting the partners below if you enjoyed this article :

If this post saved you time and money, please consider checking my Amazon wishlist.

Before submitting, some rules :
- Is your comment related to the article ?
- You're having a problem ? Have you checked Google, other howtos, docs, manpages ?
- You're still having the problem ? Have you raised log verbosity, checked traces, ran tcpdump ?
- Have you checked your configuratoin for typo ?
Unless your comment is providing additional info or respect the rules above, DON'T comment.
If you don't understand what you are doing, I urge you to read the documentation, I'm not your free Level 1 helpdesk guy.