Is it possible to obfuscate or remove environment variables from phpinfo?
If not, is the only alternative to display the phpinfo function?
Thinking about it further, someone could easily print_r($_SERVER) and get the credentials as well. What would be a solution to this?
clarification
This is in regards to Apache Environment Variables.
The Suhosin patch does this:
other than that, I am not aware of a way to cleanly hide those variables.
That said, it shouldn’t be really necessary in the first place – external visitors shouldn’t be able to run
phpinfo(), or dump arbitrary variables.