The PHP Configuration by default shows the PHP version in HTTP server header X-Powered-By to display the version installed on the server.
But for security reasons, it is generally recommended to hide the version info from attackers or hackers.
Sometimes versions has some vulnerabilities which help the attackers to find loop holes and gain access to your system. If the attacker knows the PHP version then it would be easier for them to exploit and find security holes.
Therefore in this article “Server Security – Hide PHP Version” I will be explaining how to hide PHP Version from the response header.
Suggested Read: Secure Apache Web Server
To hide the version we need to open php.ini file in the file editor.
You may find php.ini on the following locations
Debian/Ubuntu – /etc/php/7.0/cli/php.ini
CentOS – /etc/php.ini
Now locate expose_php and sets its value to Off
expose_php = off
Save the file and exit. Afterwards restart the server
$ sudo service httpd restart
$ sudo service apache2 restart
If you have any questions related to this article then leave your comments I will try to help you.
Comments
Post a Comment