Printable



 - Computing Resources @ Office of Information Technologies





Quick Links




Resources

Computer Accounts

Web Resources

Mailing Lists

E-Mail

Printing

Student Records(Banweb)


Related Links

Helpdesk

Academic Computing Services

Computing and Network Services

WebCT Courses

Instructional Multimedia Development

Computer Action Team


HOME






Using PHP, SSI & CGI Scripts with your Personal Home Pages on ODIN





General Guidelines

CGI, PHP, and Server Side Includes should all work without much modification on our server. You don't need permission to run CGI scripts, and the web server has most of the popular extensions built in.

You do not need to have a .htaccess file to use server side includes, php, or cgi scripts. If you don't know what a .htaccess file is, just ignore this paragraph.

Security Considerations

CGI programs provide a mechanism for passing information gathered from the Web into a program running under your userid. Be warned. If you use CGI programs within your Web directory, you may accidentally allow someone to snoop through, remove, or even modify the files in your Web directory. Be careful.

For information about writing secure CGI programs, see:

   - The WWW Security FAQ

   - Sanitizing User-Supplied Data in CGI Scripts

   - A CGI Security Tutorial

Note: for security reasons, a server error results if any portion of the path to a CGI program includes a symbolic link or is not owned by your account. Also, the directory containing a CGI program cannot be world writable.

PHP Scripts

To use PHP scripts, rename any file containing a php script to filename.php. Files that are referenced into your PHP script can be named anything you want.

Server Side Includes

To use server side includes, rename any file containing a server side include to filename.shtml. Files that are included into your html files can be named anything you want.

CGI Scripts

I assume you already have a web page up on the server. If not, then read the personal web pages first

To install a cgi script, first you put it somewhere under your public_html directory. Many people create a directory under public_html called cgi-bin and put scripts in that directory, but this is not required on our server.

Next you must make the file executable, do this with a 'chmod u+x filename.cgi'.

What to do if it doesn't work.

If the server says something along the lines of 'access forbidden', when you try to run the script in a browser, you need to fix the permissions on either the file or the directory containing the file. To do this, type this into the unix shell;

chmod 755 useyourfilenamehere.cgi

If that doesn't work, take a look at using permissionsand chmod.






This page maintained by: help@pdx.edu