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
If you use FastCGI try:
fastcgi_hide_header X-Powered-By;
If you cannot disable the expose_php directive to mute PHP’s talkativeness (requires access to the php.ini), you could use Apache’s Header directive to remove the header field:
Header unset X-Powered-By
if (function_exists('header_remove')) {
header_remove('X-Powered-By'); // PHP 5.3+
} else {
@ini_set('expose_php', 'off');
}
Try adding a header() call before sending headers, like:
header('X-Powered-By: Our company\'s development team');
regardless of the expose_php setting in php.ini
header_remove("X-Powered-By");
https://secure.php.net/manual/en/function.header-remove.php
If you have an access to php.ini, set expose_php = Off
.