Using PHP


  1. Check the PHP Help Pages.

  2. Apply for a UND Engineering Linux Account.

  3. Log in to the Linux Server undcemcs02.und.edu .

  4. Create a PHP Script such as ~/public_html/test.php.

  5. Open the PHP Script.
  6. Open the paths to the PHP scripts to let the browsers access them by using the command chmod, for example:
      undcemcs02> chmod 711 ~/../userid 
      undcemcs02> chmod 711 ~userid/public_html 
      undcemcs02> ls -all ~userid/public_html/ 
        total 104
        drwxr-xr-x  2 userid cslinux 4096 Jan  5  2017 ./
        drwxr-xr-x 67 userid cslinux 4096 Mar 13  2016 ../
        -rw-r--r--  1 userid cslinux 4854 Nov 20  2014 a.out
        -rw-r--r--  1 userid cslinux 5977 Jan  5  2017 index.html
        -rwx------  1 userid cslinux  227 Nov 20  2016 test.php
    
      undcemcs02> chmod 755 ~userid/public_html/test.php 
      undcemcs02> ls -all ~userid/public_html/ 
        total 104
        drwxr-xr-x  2 userid cslinux 4096 Jan  5  2017 ./
        drwxr-xr-x 67 userid cslinux 4096 Mar 13  2016 ../
        -rw-r--r--  1 userid cslinux 4854 Nov 20  2014 a.out
        -rw-r--r--  1 userid cslinux 5977 Jan  5  2017 index.html
        -rwxr-xr-x  1 userid cslinux  227 Nov 20  2016 test.php
    Note that the newest system MAY not require this step because the one executes the script may be the owner himself or herself:
     undcemcs02> 

  7. View the Execution Results from the PHP Script.
  8. You can then check the execution results of your PHP scripts on the browser. However, you are not able to view the PHP source on the browsers because PHP is a server-side language. For example, the following HTML page will call PHP script ~/public_html/test.php, the result is located at:
         http://undcemcs02.und.edu/~user.id/test.php
    An email address: