Stop Exposing Your PHP Version

Started by Skhilled, September 15, 2019, 08:55:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Exposing your PHP versions can let a hacker know how exploitable it is. Here's how to stop it.

1.  Open a terminal and locate your php.ini file by typing the following:

php -i | grep php.ini

2.  Open your favorite code editor and search for (do not add the quotes!):


3.  You will find one of these two options:

"expose_php = on" OR "expose_php = off"

4.  You want it to say "off" so it does not expose the versions.

5.  Restart Apache in your terminal by typing:

/etc/init.d/httpd restart

That's it!  :cool2: