NewtownGuy
Technical User
Hello,
I'm trying to get my first cgi-script running. I have two test machines, and both are giving me similar results:
1) Linux Fedora Core 2, Apache 2.0.49 (Fedora) Server, Perl (5.8.3), HTTP listen port 8000, on 192.168.192.94 on my LAN
2) Linux Fedora Core 3, Apache 2.0.52 (Fedora) Server, Perl (5.8.5), HTTP listen port 8000, on 192.168.192.135 on my LAN
My first.pl test script is:
#!/usr/bin/perl
printf "Content-type: text/html\n\n";
printf "Hello, World";
I'm using printf because print is not supported on OS.
I type this into IE6 on the Fedora Core 2 machine:
192.168.192.94:8000/cgi-bin/first.pl
I get this:
... Can't open perl script "\r". No such file or directory
... Premature end of script headers. first.pl
When I type
which perl
I get /usr/bin/perl, which is consistent with the first line of the script.
I type a similar line into IE6 on the Fedora Core 3 machine and I get this:
... Can't open perl script "\r". No such file or directory
... Use -S to search $PATH for it
... Premature end of script headers. first.pl
When I type
which perl
I get
-bash: which: command not found
However, perl is in the same folder as for Fedora Core 2.
I set the permission for the perl script to 777. Since the root directory is supposed to be /var/ I tried using ../cgi-bin in the URL but it didn't help. I have no idea where the \r is coming from.
I found one other post, from 2005, about this exact same problem from IamStrong, but there was no answer.
How do I fix this problem ?
Thank you.
I'm trying to get my first cgi-script running. I have two test machines, and both are giving me similar results:
1) Linux Fedora Core 2, Apache 2.0.49 (Fedora) Server, Perl (5.8.3), HTTP listen port 8000, on 192.168.192.94 on my LAN
2) Linux Fedora Core 3, Apache 2.0.52 (Fedora) Server, Perl (5.8.5), HTTP listen port 8000, on 192.168.192.135 on my LAN
My first.pl test script is:
#!/usr/bin/perl
printf "Content-type: text/html\n\n";
printf "Hello, World";
I'm using printf because print is not supported on OS.
I type this into IE6 on the Fedora Core 2 machine:
192.168.192.94:8000/cgi-bin/first.pl
I get this:
... Can't open perl script "\r". No such file or directory
... Premature end of script headers. first.pl
When I type
which perl
I get /usr/bin/perl, which is consistent with the first line of the script.
I type a similar line into IE6 on the Fedora Core 3 machine and I get this:
... Can't open perl script "\r". No such file or directory
... Use -S to search $PATH for it
... Premature end of script headers. first.pl
When I type
which perl
I get
-bash: which: command not found
However, perl is in the same folder as for Fedora Core 2.
I set the permission for the perl script to 777. Since the root directory is supposed to be /var/ I tried using ../cgi-bin in the URL but it didn't help. I have no idea where the \r is coming from.
I found one other post, from 2005, about this exact same problem from IamStrong, but there was no answer.
How do I fix this problem ?
Thank you.