Back to DFS's Workshop Page
Back to Agenda Page


Your First Script

Your first script will generate the traditional "Hello, World!" greeting on the command line. Follow the simple steps below.

  1. Type

    cd
    to get to your home directory.

  2. Type

    mkdir public_html/test_php
    to create a new directory called PHP.

  3. Type

    cd public_html/test_php
    to descend into the newly created directory.

  4. Using vi, vim or some other editor, create a new file called helloworld1.php.

  5. Type in the following lines:

    <?php
    echo "Hello, World!\n";
    ?>
  6. From the command line inside the test_php directory which you created, type

    php -f helloworld1.php

Notes


© DFStermole: 2002-2005
Created: 22 Sept 02
Last Modified: 25 Oct 05