Effectively hide php version information and reduce the risk of website being attacked by hackers
Check whether the php version number is currently enabled
curl -I http://你的地址
X-Powered-By: PHP/5.6.22
Here you can see that the php version information of the current address is 5.6.22
You can check the php.ini path through the command. My php.ini path is in /usr/local/php/etc/ php.ini
php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/php/etc Loaded Configuration File => /usr/local/php/etc/php.ini
Edit /usr/local/php/etc/php.ini
Find the expose_php parameter
Change expose_php = On to expose_php = Off, and then restart php can
/etc/init.d/php-fpm restart
Verification
curl -I http://你的地址
At this time the php version number has been hidden
Recommended: "PHP Tutorial"
The above is the detailed content of How to hide php version information. For more information, please follow other related articles on the PHP Chinese website!