Home  >  Article  >  Backend Development  >  How to hide version in php

How to hide version in php

藏色散人
藏色散人Original
2020-07-03 10:42:024328browse

How to hide the version of php: 1. Check the current php version number; 2. Locate the "php.ini" file; 3. Check the configuration file currently used by PHP; 4. Hide the version number and restart apache.

How to hide version in php

PHP hidden version number

PHP itself does not enable the listening service, so prevent scanner scanning To determine the vulnerability through the version number, what we want to hide is the version number in the http header, not the version number in the system command line.

1. Check the current php version number

Access any page in the current service and intercept the response packet

2. Locate the php.ini file


locate php.ini

3. View The current configuration file used by PHP [optional]

It should be said that the configuration file used by PHP is generally /etc/php.ini, but it is not necessarily so it can be further confirmed.


php -i | grep php.ini

Probably the most authoritative page to visit the classic phpinfo.php

4. Hide the version number and restart apache (if you use other http servers, restart them in their own corresponding ways)

Edit the found configuration file and set the default expose_php = On Modify to expose_php = Off


##

service httpd restart

5. Cut the package again to check that there is no X-Powered-By header

Recommended: "

PHP Tutorial"

The above is the detailed content of How to hide version in php. 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
Previous article:How to modify url in phpNext article:How to modify url in php