Screen Printing

TUTORIALS » PHP / MySQL » PHP essentials (guided tutorials)

Test if PHP works on your server



There is an easy way of knowing if PHP is properly running on your server.


To test if PHP works:

  1. Open any text editor and create a new file. Write:
    <?php 
      phpinfo(); 
    ?>
    
  2. Save your file as test.php and upload it to the root folder of your server.
    Note: If you are a Windows user, make sure all file extensions are being displayed.
  3. Test your file by opening your browser, entering the URL of your file in the address bar
    [ http://nameofyourserver/test.php ], and pressing ENTER.
    Note: The name of your server can be something like www.yoursite.com if you signed up for a server on the internet or localhost if you set up your own computer to work as a local web server.
You should see a large table of information, with the PHP logo and version at the very top. If you don't see it, your server does not have PHP installed or PHP is not properly started.

If PHP does not work, you should contact your hosting service provider.

If your server is PHP-ready, you can proceed to the next tutorial.

Comments & Questions