Technical FAQ

General | PHP | CGI | E-Mail | MySQL < || > Online Manual

CGI-Scripts and Programming Languages

- How do I run my own CGI programs?
- What is the correct path to perl and other programs?
- Can I run scripts outside of my cgi-bin?
- How Should I set my file permissions on cgi-scripts?
- What version of Perl is installed?
- Why does my script produce an 500 Internal Server Error?
- Do you upgrade Perl when new releases are available?

 


Q: How do I run my own CGI programs?

A: Put your CGI programs in the cgi-bin directory. Make sure you upload them in ASCII mode. Change permissions to 755 for the script (chmod 755 script-name). Access them via: http://www.yourname.com/cgi-bin/script-name

Back to top


Q: What is the correct path to perl and other programs?

A:

perl.........: /usr/bin/perl
sendmail.....: /usr/sbin/sendmail
date.........: /bin/date
python.......: /usr/bin/python
tcl..........: /usr/bin/tcl

domain path..: /home/
username/www
cgi-bin path.: /home/
username/www/cgi-bin

If you are looking for other programs, just try "which programname" i.e "which perl"

Back to top


Q: Can I run scripts outside of my cgi-bin?

A: Yes, any script you setup outside of your cgi-bin must have a .cgi extension rather than .pl. If the file you are using has an extension other than .cgi and you would like to run it outside your cgi-bin you can just rename the file to *.cgi so it will execute properly.
If you really need the .pl extension outside your cgi-bin, you can add the following to your .htaccess file:
AddType application/x-httpd-cgi .pl
AddHandler cgi-script .pl

Back to top


Q: How Should I set my file permissions on cgi-scripts?

A:  CGIs must be set with executable file permissions, or requests for the script from the web server will result in an Internal Server Error. Scripts that need to be executable should have their permission set with chmod 755. This sets the file's permissions so that the file's owner may read, write, and execute the file; and anyone else can only read and execute it.

There are some freeware or perhaps even commercial Perl scripts which may require you to set a directory to rwxrwxrwx (chmod 777). This is not necessary. Setting the directory permissions to 755 should always be sufficient. If you do set any directories to rwxrwxrwx, then any Perl scripts located inside this directory will not execute.

Back to top


Q: What version of Perl is installed?

A: Currently we are using version 5.6.1

Back to top


Q: Why does my script produce an 500 Internal Server Error?

A: This can have many causes, ranging from incorrect permissions to syntax errors within the script.
Check permissions and ownership:

1. Does the main user of the domain own the script?
2. Do the script and its parent directory both have 755 permissions?
3. Was the script uploaded in ASCII mode, not binary?

Back to top


Q: Do you upgrade Perl when new releases are available?

A: Yes. Once a new build of Perl has been deemed as stable versus experimental, we will implement a upgrade across our network based on how it may affect existing scripts already in operation.

Back to top

 

- Last modified on 3/19/2003 -


Home / Hosting / Domain Lookup / Support / Email Contact

© 1998-2024 Spunkyworld Internet Services - All rights reserved