Web Stack Getting Started Guide

Testing the Development Environment

To test whether the development environment you have set up is working fine, perform the following simple steps:

ProcedureTo Test the Development Environment

Before You Begin
  1. Select Developer Tools > Web Stack Admin > Sample App > Create to create a web application.

    Alternatively, you can copy the following code into a text file.


    <DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>My First Web App</title>
    	</head>
    <body>
    <b>Hello, World!</b>
    <p>The date and time are <?php echo date ("r"); ?> - isn't that nice? - isn't that nice?</p>
    </body>
    </html>
  2. Save the file to /var/apache2/2.2/htdocs/hello.php.

  3. Open a web browser and enter the URL http://localhost/hello.php in the address bar.

    The following message is displayed in the web browser, where the date and time reflects your system's current date and time:

    Hello, world!

    The date and time are Thu, 20 Dec 2007 16:01:07 +0200

    • Select Developer Tools > Web Stack Admin > Sample App > Run.

Next Steps

Success! Note that the web page contents enclosed within the <?php and ?> de-limiters were interpreted by the PHP interpreter at the time the Apache Web Server served up that page. The output of those PHP language statements were substituted into the HTML stream at that location. All other HTML content is served up to the web browser as in static web pages.

Now, reload your browser but make sure that your browser does not use its cache; in most browsers, you can reload the browser by holding down the Alt key while clicking the Reload button. You see the same result, but with a later time. Thus you can see that a PHP page gets executed every time it is displayed (barring local browser caching, which you can suppress through PHP directives), and that you, as a developer, can generate highly dynamic content.