IT 202 - Web and Multimedia Technology

Lab 9 - Fall 2007

Due: Thursday 11/1/2007 by 11:59 pm.

For lab this week, we want to set up our web server to handle PHP and write a simple PHP-enabled web page.

The following is the steps to install .php support for apache2 in ubuntu. Recall that apache2 is the apache package designed by ubuntu. The commands given below are expected to be run from a command line prompt in a terminal window.

  1. Setup the sources.list file for apt
    	sudo pico /etc/apt/sources.list
    
    Add the following line to the source.list file
    	deb http://192.168.1.1 feisty main
    
    This will direct you machine to the package/installation files that are set up on one machine in the lab.

  2. Then get the most recent package list from the server
    	sudo apt-get update
    

  3. Install the PHP package from the server
    	sudo apt-get install php5
    

  4. To test is you have PHP up and running, create a simple PHP web page and see if it will display properly.

    In your DocumentRoot directory, create a file test.php. You can use any text editor you like instead of using pico in the command.

            sudo pico test.php
    
    This file should contain something like:
            <html>
            <body>
            <?php
               phpinfo();
            ?>
            </html>
            </body>
    
    The phpinfo() function displays a large amount of data about the web server.

A PHP Generated Table

After you have gotten PHP working, write a web page that will give the Celius to Fahrenheit tempurature values for the Celius values from 0 to 100 in steps of 10 (i.e. 0, 10, 20, 30, ... 100). The values should be given in a table with one side showing the degrees Celius and the other side showing the degrees Fahrenheit.

This lab assignment is to done in the lab in SEL 2264.