Testing the PHP environment on csdb

You can test whether PHP interacts properly with the Apache web server on csdb by following the steps below:

  1. Log into csdb, then change to directory html.
  2. Use /usr/local/bin/pico to create a file named myPHPtest.php (note that the file extension must be ".php" (instead of ".htm").
  3. Insert the following code in the file:

       <?php echo "Hello World! This is my PHP test!"; ?>

  4. Save the file in the folder html.
  5. Add read permission to your file by typing at the shell prompt

       chmod go+r myPHPtest.php

  6. Now you can open the file in your browser with the address

       http://csdb.csc.villanova.edu/~yourusername/myPHPtest.php

If the browser writes Hello World! This is my PHP test! then the environment works well for you.

Remember to always save your files and folders in html.

Files must have read permissions:

   chmod go+r myfile.php

Directories must have read and execute permissions:

   chmod go+rx mydirectory