Home >Backend Development >PHP Problem >How to hide php version

How to hide php version

藏色散人
藏色散人Original
2020-04-25 11:43:022336browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn