PHP Quick Tip: PHP Info



Sometimes you need to find out the PHP version, extensions, compile options and server details from a web server (for example, before installing a web application that has specific requirements such as needing a certain version of PHP or certain extensions).


Doing this is extremely simple. Simply create a brand new, blank text file on your PC, with a .php file extension. Call it ‘info.php‘ or something like that. Using a text editor (Windows’ Notepad or Wordpad will suffice for this), open the file and add the following code:

<?php

phpinfo();

?>



Then Save and Close the file, and upload to your website using an FTP client.


Next, point your browser to the new file on your site (so if your site is called ‘bobswebsite.com’ and you uploaded the new info.php file to the ‘root’ of the site {i.e. not in any subfolder on the website} then you’ll need to type ‘http://www.bobswebsite.com/info.php‘ into the browser’s website address {URL} window).


The browser will display the server’s PHP info in a web table, which will look something like this:

PHP Info

Your web server's PHP Info will come up in a nicely-formatted web table...

So a thirty-second job can return a huge amount of useful information to you about the server your website is hosted on. Simple!

Comments are closed.