Assume that you have a sample Perl script that only print the clear text and you still got the premature end of script headers error.
Sample Perl Script used.
#!/usr/local/bin/perl print “Content-type: text/html\n\n”; print “Hello, Mick Genie!\n”;
Step to overcome the problem.
1. Check the Apache error_log or domain error log.
2. Check if the perl script come with permission 755 where this will allow the script to execute.
3. Check the suexec.log from your Apache log.
4. Upload your Perl script in ASCII mode.
Once you have done the above step and still get the same error, follow the step as below to track the perl error.
1. Tracking the error from script.
perl -wc perl.pl
This will allow you to check if there is syntax error.
2. Track error without syntax error.
perl -w perl.pl