KnowledgeBase Glossary    Contact Us
Browse by Category KnowledgeBase .: CGI and/or PERL Issues .: Troubleshooting PERL Script Errors

Troubleshooting PERL Script Errors

If a PERL script does not execute correctly check the following:

1) Upload the file in ASCII mode.

2) Make sure the PERL script is uploaded to the cgi-bin directory.

3) Set the PERL script's permissions to 755

4) On a VPS, make sure your site's cgi-bin directory is set to 755 permissions. Any other set of permissions (including 777 permissions) is likely to result in the "Premature end of script headers" error message.

5) If you have access to a Linux shell prompt for the site, try executing the command:

perl c

This will check the PERL script for correct syntax, as well as help determine if the file was uploaded in binary mode.

6) If you have access to a Linux shell prompt for the site, execute the script. If your working directory is the directory the script is in, execute the following command to execute the script:


7) Check the Apache error log for the site. Frequently there are clues to why the script is not executing correctly in the Apache error log.

8) Check the size of your log files. If the /var/log/httpd/suexec.log is 2 GB in size your perl scripts will return a "Premature end of script headers" error message.

In the above examples, replace "" with the actual name of your PERL script.

How helpful was this article to you?

Related Articles

article Premature end of script headers
See the following...

(No rating)  10-18-2005    Views: 6415   
article How should I set up the paths within my perl CGI scripts?
Use the following command from a shell prompt...

  7-11-2005    Views: 10049   
article Troubleshooting PHP Scripts
If you cannot figure out the problem with your...

  1-19-2006    Views: 12995   

User Comments

No comments have been posted.

.: Powered by Lore 1.5.4
Copyright 2005-2014 Advantagecom Networks, Inc. - Xen Linux Virtual Private Servers (VPS) - Paypal Accepted