I know that header_remove doesn't work in php versions < 5.3 and I use 5.2.1. I am looking for an alternative to header_remove to remove the X-Powered-By header.
I tried using header("X-Powered-By: "); but it still generates a blank header. I tried using Header unset X-Powered-By in .htaccess, but for some reason it's not working. I am stuck here.
if you want to remove header information about php version (x-powered-by), you can use: header_remove('x-powered-by');
There is an easy way to hide the PHP version from the HTTP headers. By setting the “expose_php” variable to Off in your php. ini file the PHP version would not longer be added to the HTTP headers.
The get_headers() function in PHP is used to fetch all the headers sent by the server in the response of an HTTP request. Parameters: This function accepts three parameters as mentioned above and described below: $url: It is a mandatory parameter of type string.
AFAIK, there is no replacement for this function, but you can either alter the result to something bogus as described above, or configure php.ini to block this header with the following statement:
expose_php = Off
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With