Because every system is setup differently, phpinfo () is commonly used to check configuration settings and for available predefined variables on a given system.
By finishing this tutorial, you’ve learned how to create a phpinfo.php file and how to check PHP information via your hosting control panel or your default browser.
During a passive reconnaissance session, I encountered an exposed phpinfo() page on a production server owned by a well-known company. This misconfiguration leaked a wide range of sensitive server data — including environment variables, file paths, and PHP modules — and could have assisted attackers in crafting targeted exploits.
The phpinfo() function is a valuable tool for PHP developers and server administrators. By creating and accessing a phpinfo file, you can gain insights into your server’s PHP configuration, which can help you optimize your applications, troubleshoot issues, and enhance security.
Learn to create a phpinfo file to view your server’s PHP configuration. Our step-by-step guide helps you find settings and securely remove the file.
Learn how to create a phpinfo() page to retrieve lots of information aboout your environment like version of PHP, extensions in use, EGPCS data, and more.
Quick Answer: To check your PHP configuration, create a file named `phpinfo.php` containing the single line ` `. Place it in your web server’s root directory and access it via a browser. This script executes the `phpinfo ()` function, generating a comprehensive report detailing your PHP version, loaded extensions, environment variables, and `php.ini` settings.