Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

(2)No such file or directory: exec of '/var/www/cgi-bin/index.cgi' failed

Avatar of gautam_reddyc
gautam_reddyc asked on
PerlScripting Languages
8 Comments1 Solution5540 ViewsLast Modified:
Hello I am a newbie to perl-cgi. I am trying to run the hello world cgi script but Apache keeps giving me "500 Internal Server Error". So I checked my apache error log to see what the issue was, and I get this "(2)No such file or directory: exec of '/var/www/cgi-bin/index.cgi' failed" error, and below that another log mentions "Premature end of script headers: index.cgi". I tried to see if the shibang line was wrong and went back to test the perl script, and it worked fine. I also double checked the perl path by doing "which perl" and my shibang line was right. I am adding the code snippet that I am using, could anyone tell me what could the problem be, and a possible solution.

I am using a ubuntu as my OS. I have assigned webserver as the owner of the cgi-bin folder and also have set executable file permissions, by using chmod 755.
#!usr/bin/perl

print "Content-type: text/html\n\n";
print "hello world";
ASKER CERTIFIED SOLUTION
Avatar of Frederick McIntyre
Frederick McIntyreFlag of United States of America imageProgrammer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers