Testing the PHP installation (Windows)

Testing the PHP installation (Windows)

You can test the PHP application server by running a test page.

To test the PHP application server:

  1. In Dreamweaver or any text editor, create a plain text file and name it timetest.php.
  2. 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.

  3. Copy the file to the C:\Inetpub\wwwroot folder of the Windows computer running IIS.
  4. 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:

    http://localhost/timetest.php

The test page should open and display a time of day, as follows:

This is a picture of the feature being described.

The specified time is known as dynamic content because it changes every time you request the page. Click your browser’s Refresh button to generate a new page with a different time.

If the page doesn’t work as expected, check for the following possible errors:

  • The file does not have a .php extension.
  • You typed the page’s file path (C:\Inetput\wwwroot\timetest.php) instead of its URL (for example, http://localhost/timetest.php) in the browser’s 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).)



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly