I spent hours and hours trying to fix an Internal Server Error on a perl program. I distilled the program down to the very simplest, and nothing would work. In fact, here's the entire program:
#!/usr/local/bin/perl
use strict;
print "Content-type: text/html\n\n";
print <<"thepage";
<html><head><title>Test</title></head><body>
<p>help</p>
</body></html>
thepage
Couldn't get it to work. Permissions correct. Same directory where I have literally a hundred other scripts running constantly. httpd.conf fine. It runs from the command line when SSHing into the server. Error message says:
[Mon May 18 09:59:29 2020] [error] [client 98.190.183.148] (13)Permission denied: exec of '/data/www/facialsurgery/root/cgi-bin/test_print_2.pl' failed
[Mon May 18 09:59:29 2020] [error] [client 98.190.183.148] Premature end of script headers: test_print_2.pl
But I fixed it! By adding "-w" to the shebang line, so the line says:
#!/usr/local/bin/perl -w
But I have, as I mentioned, many many programs running fine without the -w. What can I do to trace this down more, so I don't eventually run into more trouble with more important programs?? Thanks so much for any insight in this.