Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Perl is intalled and running on my box. If I type the following at the command line, my script executes fine:
perl /var/www/cgi-bin/hello.cgi
I have the correct permissions in the cgi-bin (I think) and Apache is pointing at the right folder for running scripts, however my file keeps throwing the following error:
Quote:
Can't open perl script "/var/www/cgi-bin/hello.cgi": No such file or directory.
Use -S to search $PATH for it.
The code itself is blindingly simple... good ol' "Hello World!"
Code:
#!/usr/bin/perl
print "Hello, world!\n";
That's it. I've checked the path the Perl and is seems right. Other system info is:
Fedora 3
KDE
Perl 5.8.5
Apache 2.0.52
What am I doing wrong? All I can find in Google is references to what's new in Perl 5.8.5!
The \r is gone now - figured out what that was - looked like Linux didn't like the Windows line endings - converted to Unix and no probs there. There's a new error instead!!
Quote:
(2)No such file or directory: exec of '/var/www/cgi-bin/hello.cgi' failed
Premature end of script headers: hello.cgi
This is driving me nuts! The worst part is that it's damned near impossible to get a decent search out of Google using \(): etc.! *sigh*
Starting to get somewhere on this now... Leave a newbie alone for long enough and they'll stumble across the answers!
Anyways, the first error was caused by Windows line endings - fixed!
The second error I can now fix, but it's still weird. The behaviour is as follows.
1. Script won't execute - error as detailed in post above
2. Change the # line to have a "-w" at the end of it
3. Script works
4. Change # line back
5. Script continues to work fine forever!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.