Note: Apple Technical Suport does not offer free technical support for troubleshooting CGI executables.
Use these notes to help troubleshoot your server when CGIs are enabled.
1. If you wish to run AppleScript CGIs, you must be running Mac OS X Server, and you must run the ACGI Enabler application (/Applications/Utilities/). AppleScript CGIs are not supported on Mac OS X 10.3.
2. If you are running non-AppleScript CGIs, be sure to use UNIX line breaks in your file, not Macintosh line breaks.
3 When using TextEdit as a text editor, it should use UNIX line breaks. Be sure not to save as RTF.
4. Be sure that the path to the executable is set properly at the top of the script. For example, this header is incorrect and will generate errors:
#!/usr/bin/local/perl
The perl program is found in /usr/bin, not /usr/bin/local. To verify the path to a program, use the "which" command in Terminal.
5. Be sure that CGI programs have read and execute privileges. You can use the "chmod" command in Terminal to add read and execute privileges. See the "chmod" man page for more information on using this command.
6. If you are running Mac OS X Server, be sure that you have enabled CGI execution for your site in the Server Admin.
7. If you are still seeing errors after following these steps, refer to the Web Server error logs for clues as to why the CGI is failing. In Mac OS X Server, you can use the Log Viewer in Server Admin to see the Web Server Error Log. In Mac OS X, you can use Console to read the logs, which are found in /var/log/httpd.