Example 4 - Sample Form
Steps to Run Scripts from UTS
- If you haven't already created a public_html directory in your logon
directory, do so now. To create it, type:
mkdir $HOME/public_html
- Within your public_html directory, create a cgi-bin directory. To
do so, type:
mkdir $HOME/public_html/cgi-bin
- Be sure to put all your PHP scripts in the cgi-bin directory
- The first line of the script must contain the following:
#!/usr/local/apache/bin/php
- Use the appropriate URL to execute a script:
http://uts.cc.utexas.edu/~username/cgi-bin/cgiwrap/scriptname.php
Where username is your user name and scriptname is the
name of the script.
Restrictions
- You must own the script. To see the owner's user name, type:
ls -l $HOME/public_html/cgi-bin/scriptname
- Your default group must own the file. To see a list of the groups
you are a member of, type:
groups
Your default group should be the first one listed. To see the group
ownership of the file, type:
ls -lg $HOME/public_html/cgi-bin/scriptname
- The script must be executable. To make the program executable, type:
chmod 755 $HOME/public_html/cgi-bin/scriptname
- Scripts must be located in your $HOME/public_html/cgi-bin directory.
- The file permissions may NOT have the setuid or setgid bits set.
- Scripts have a resource LIMIT of 10 CPU seconds.
Notes
This method is recommended for PHP scripts the need to save data to the local file system. This includes creating, modifying, and or deleting files and directories. By using this approach. The files you create have the appropriate user id. If you have questions about this approach, please make an appointment with a Teamweb consultant.
|