Frequently Asked Questions
Table of Contents
- I'm wondering about running scripts using some interpreter that's not Perl or PHP. How do I do it?
- Using the suexec debug mode, the error says
No such file or directory: exec failedeven though the permissions are correct. - How can I send email? I can't find the sendmail program.
- What logging is available?
I'm wondering about running scripts using some interpreter that's not Perl or PHP. How do I do it?
Your CGI programs can be any executable for the server OS, but if it requires
an interpreter it will only work if the interpreter is installed on the
machine. Currently only Perl and PHP are officially supported. For Perl
put "#!/usr/bin/perl" as your first line in the script. For PHP
you do not have to add a line unless you wish to specifically use PHP4
rather than the default of PHP5.
If you wish to use PHP4, put "#!/usr/bin/php4-cgi" as your first
line in the script.
Using the suexec debug mode, the error says No such
file or directory: exec failed even though the permissions are correct.
Open your script in vi, and make sure it does not contain ^M characters on ends of lines (happens when you ftp files, or copy into afs from Windows). If it does, run this command at the Unix command-line to convert the file:
dos2unix <current_name> <new_name>
How can I send email? I can't find the sendmail program.
For sending email, direct SMTP connections can be utilized. A
sendmail emulator is available to CGI scripts at the path
/usr/sbin/sendmail but is not guaranteed to work. You can also use
Perl modules to send mail, see the Net::SMTP
example.
Please be aware that it violates Stanford security policy to allow users of your scripts to freely set the recipient address or in any other way abuse the emailing capability of the CGI service. It is recommended you only use this feature to send administrative notifications to yourself.
What logging is available?
The error log is no longer available for online viewing due to increasing privacy concerns. Users are advised to take advantage of the suexec debug mode, described in the Debugging Programs.



