Using PHP


  1. Check the PHP Help Pages.

  2. Apply for a UND Engineering Linux Account.

  3. Use VPN (Virtual Private Network) to connect to the UND networks.
  4. You may not need to do this if you are on campus.

  5. Log in to the Linux server undcemcs02.und.edu .

  6. Create a PHP script such as ~/public_html/test.php.

  7. Open the PHP script.
  8. Open the paths to the PHP scripts to let the browsers access them by using the command chmod, for example:
      shell> chmod 711 ~/../userid 
      shell> chmod 711 ~userid/public_html 
      shell> 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
    
      shell> chmod 755 ~userid/public_html/test.php 
      shell> 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:
     shell> 

  9. View the execution results from the PHP script.
  10. 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://shell.und.edu/~user.id/test.php
    An email address: