-- online Search!

Testing your PHP Installation

code by eyezberg & explanation by kirupa   | filed under Web, HTML, CSS, and XML

TL;DR

To check that PHP is installed and configured properly on your server, save a tiny PHP file such as info.php in Notepad or another ASCII editor, upload it, and open it in your browser. If PHP works, you'll see a page like kirupa.com's own info.php example.

  • You can name the file anything you like, as long as it ends with the .php extension.
  • Without PHP, you may get a server error, see the code you copied displayed, or be prompted to download the PHP file.
  • The article doesn't explain installing PHP; server administrators are pointed to php.net for more information.

This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.

PHP is the popular scripting language that many Web sites use to create dynamic pages. For example, this site's forums are largely dependent on PHP and its ability to fetch and post data from various sources such as a mySQL database.

Of course, in order to take advantage of PHP, you will need to have PHP functioning on your server. This article will not explain how to install PHP, but this article will explain how to test if PHP is installed and configured properly in your server:

The Code

First, launch Notepad or another ASCII text editor. Simply type the following and save the file as info.php or anything similar as long as the file extension is .php.

  <?
phpinfo();
?> 

[ copy the above into Notepad/ASCII editor and save the file with a .php extension ]

Once you have your file saved with a .php extension (info.php for me), upload the file to your Web server. Once the file has been uploaded to your server, preview the file you uploaded in your Web browser.

If PHP is successfully installed, you should see something similar to what you see in the following URL: http://www.kirupa.com/web/info.php

If you do not have PHP installed, you may receive a server error message, the code you copied displayed, a prompt to download the PHP file, or any other number of reasons. If you are a server administrator, visit the following URL for more information: http://www.php.net/

I hope this information helped. If you have any questions or comments, please don't hesitate to post them on the forums found by clicking here.

Regards,

eyezberg
External resource (archived resource unavailable) kirupa

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums.

Your support keeps this site going! 😇

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--