phpinfo().. The most important function call in PHP Scripting Language


Every programmer or software engineer working in LAMP (Linux/Apache/MySQL/PHP), MAMP, XAMPP or WAMP (Windows/Apache/MySQL/PHP) environment should first learn a basic php command :


It is the most important function call and the output of this function provides wealth of information about PHP and the apache server environment in which your PHP scripts will be executed. The amount of information provided by this function is very usedful in debugging your PHP scripts. This script is also useful for people who are going to maintain your website and install/uninstall different components or modules.

So every engineer/programmer who is dealing with Drupal, Magento, Joomla or any PHP based software can have following script copied into its main server directory and can run the script like:



echo phpinfo();


It provides following information:

  • The configuration line,
  • php.ini location,
  • build date,
  • Web Server, System
  • Current and Master values of php directives
  • Additional module(s) loaded and their respective settings
  • Environment variable information that is available
  • PHP License information.

So engineers,programmers and system professionals dealing with PHP.. carry this script always in your toolbox.