Categories
· Show all categories
· New Customer FAQs
· E-Mail
· FTP - File Transfers
· Domains
· SSH and Telnet
· Scripting Languages
· Perl - Cgi
· Password Protection
· MySQL
· Stats
· Power Tools
· FAQ Home
· EchoEcho+ Support
|
Perl - Cgi: What are the most obvious errors to look for with perl scripts?
|
By default cgi will only run inside your cgi-bin folder. This folder is located at /var/www/cgi-bin (outside your main website folder, located in /var/www/html).
You can enable scripts in all folders on your site, using the simple trick described here:
How do I enable scripts outside of my cgi-bin folder?.
If you're sure the script is in the correct folder,
you can use this list to double check for the most common pitfalls:
1: Make sure the first line in your script looks like this: #!/usr/bin/perl
2: Make sure the file has a .cgi extension.
3: Make sure you used ASCII mode to upload the file.
4: Make sure both the folder and the file has chmod set to 755
(Do this with your FTP program).
5: Make sure the script prints the content type before any plain html.
For example:
print "Content-Type: text/html\015\012\015\012";
6: Make sure the script prints the content type even if the script has no real output.
7: Make sure all lines ends with a ; (semi colon).
8: Make sure all print statements have the same starting and ending quotes - either single or double as long as it's the same.
9: Make sure that your use of $, @ and % in print statements are not confused with scalar, array or hash variables.
10: If none of the above works try commenting parts of the script (with #), then upload and test it, to locate the area that has the bug.
If everything else fails, you should try this:
I have tried everything and now I doubt perl is working correct on my domain!
Last update: 12.07.2009, 21:13 Author: EchoEcho Support
|
You cannot comment on this entry | Content Overview: Perl - Cgi
|
|
|