Home >Backend Development >PHP Problem >How to hide php version
How to hide the PHP version
Effectively hide the PHP version information and reduce the risk of the 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 the php version information of the current address It is 5.6.22
You can check the php.ini path through the command. The php.ini path here is /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
/etc/init.d/php-fpm restart
Verification
curl -I http://你的地址
At this time, the php version number has been hidden
For more related tutorials, please pay attention to php Chinese website.
The above is the detailed content of How to hide php version. For more information, please follow other related articles on the PHP Chinese website!