Testing the PHP installation (Windows)
You can test the PHP application server by running a test page.
To test the PHP application server:
- In Dreamweaver or any text editor, create a plain text file and name it timetest.php.
- In the file, enter the following code:
<p>This page was created at <b>
<?php echo date("h:i:s a", time()); ?>
</b> on the computer running PHP.</p>
This code displays the time the page was processed on the server.
- Copy the file to the C:\Inetpub\wwwroot folder of the Windows computer running IIS.
- In your web browser, enter the URL of your test page, and then press Enter.
If you installed PHP on your local computer, you can enter the following URL:
The test page should open and display a time of day, as follows:
The specified time is known as dynamic content because it changes every time you request the page. Click your browsers Refresh button to generate a new page with a different time.
If the page doesnt work as expected, check for the following possible errors:
- The file does not have a .php extension.
- You typed the pages file path (C:\Inetput\wwwroot\timetest.php) instead of its URL (for example, http://localhost/timetest.php) in the browsers Address text box.
If you type a file path in the browser (as you might be used to doing with normal HTML pages), you bypass the web server and the application server. As a result, your page never gets processed by the server.
- The URL contains a typing mistake. Check for errors and make sure the filename is not followed by a slash, such as http://localhost/timetest.php/.
- The page code contains a typing mistake.
After installing and testing the server software, create a root folder for your web application. (See Creating a root folder (Windows).)