Check to see what the error is in the Apache error log or add
use CGI::Carp 'fatalsToBrowser';
in your script.
Did you chmod +x the script?
Main Topics
Browse All TopicsMy /etc/apache2/sites-availab
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options FollowSymLinks +ExecCGI
#Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler cgi-script .cgi .pl
</Directory>
/usr/lib/cgi-bin/perltest.
###Start###
#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing .<br />\n";
for ($i=0; $i<10; $i++)
{
print $i."<br />";
}
###End###
I try to execute the script via the browser:
http://server/cgi-bin/perl
I get the error: HTTP 500 page can not be displayed, internal server error.
I followed this guide to set this up: http://www.ubuntugeek.com/
I know my setup is slightly different.
Any suggestions?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The script has these rights as described in the question: 755 = u=rwx,g=rx,o=rx.
/var/log/apache2/error.log
[Tue Mar 24 16:17:16 2009] [error] [client 192.168.1.101] (8)Exec format error: exec of '/usr/lib/cgi-bin/perltest
[Tue Mar 24 16:17:16 2009] [error] [client 192.168.1.101] Premature end of script headers: perltest.pl
So I guess there is something wrong with the script. I have not really started reading on creating CGI files with Perl, but wanted to see my Apache server being able to run the scripts anyway. The script was copied from a tutorial page on the net. Anyone see anything wrong with it?
Business Accounts
Answer for Membership
by: caterham_wwwPosted on 2009-03-22 at 12:20:09ID: 23952804
> Options FollowSymLinks +ExecCGI
Don't mix +/- and non +/- options; either
Options +FollowSymLinks +ExecCGI
or
Options FollowSymLinks ExecCGI
> I get the error: HTTP 500 page can not be displayed, internal server error.
What can you find in your error_log?