You can use a phpinfo() page to view php information that is currenttly on your server.

This file is quite large as it outputs alot of information such as:

  • The version of PHP
  • Information regarding PHP extensions and compilation options.
  • Information regarding the server and environment(if compiled as a single module).
  • PHP information.
  • Version of operating system, paths, local and master values of configuration options.
  • HTTP headers.
  • PHP license.

Since every system is set up differently, phpinfo() is most commonly used to check the php settings and for predefined variables on your system.

How to create a phpinfo.php page

In order to create a phpinfo file, open a brand new text file, add the following lines and save it to your desired path. Save it as "phpinfo.php"
"?php //Show all information, defaults to INFO_ALL phpinfo(); ?

      1. Upload the phpinfo file to the server. You should upload your file to the same directoty you want to test. Commonly you will be at your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory of your choice aswell.
      2. Use an FTWP client to upload the file, you can use WINSCP or Filezilla, these are just examples of course.
      3. Visit the page in your preferred browser such as Google Chrome, Firefox and so on. If you uploaded it your HTML directory, you should now visit http://www.yourwebsite.com/phpinfo.php replacing yourwebsite.com with your own domain name.
      4. Finally you can view all of your information about the PHP for your server for that directory.



Was this answer helpful? 1 Users Found This Useful (45 Votes)