How to hide version in php

藏色散人
Release: 2023-03-01 21:16:01
Original
4479 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!