How to setup your first PHP page on

  1. Make sure you have read and setup the required directories and permission as described in FAQ section on Prerequisites for hosting a web page on
  2. Change your working directory to the public_html directory.
     > cd ~/public_html
  3. Open a command line session to
  4. Use an editor like vi or pico to create the index.php file. Refer to the FAQ pages on editors on Pico being the simple Unix editor to use.
     > pico index.php 
  5. Use the editor to insert some HTML into the file, a simple HTML content is shown below.
               <title> This is my first page </title>
              <h1> My first page</h1>
              <?php  echo "<p>Hello World </p>" ?>
  6. Save the file and return to the command line.
  7. Grant everyone (others) read access to the file you just created.
     > chmod o+r index.html
  8. Open a browser and point it to: and you should see the file you just created.
  9. If you get an error, tail the /var/log/apache2/error_log (the tail command shows any new lines added to a file) while you try to access your page to see if there are any errors. If you don't see errors in error_log, you should tail /var/log/apache2/suphp.log as well and then try to access your page again to see if any errors are reported.
     > tail -f /var/log/apache2/error_log 
  10. If you still can't get your PHP program working, see if the student resource center can be of any assistance or send an email to and someone will help you identify the problem.
FAQ Priority: 
FAQ Category: 
Web Related