For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > June 2006 > CGI and Apache









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CGI and Apache
Chen Li

2006-05-29, 9:55 pm

Dear all,

I just install apache 2.2 on my Windows XP using all
the default settings. I run the printenv.pl script
from Apache. I change the first line of the script to
#!c:\Perl\bin\perl.exe (or
#!c:/Perl/bin/perl.exe ) get this information

[client 127.0.0.1] (OS 2)The system cannot find the
file specified. : couldn't create child process:
720002: printenv.pl
[Mon May 29 20:39:18 2006] [error] [client 127.0.0.1]
(OS 2)The system cannot find the file specified. :
couldn't spawn child process: C:/Program Files/Apache
Software Foundation/Apache2.2/cgi-bin/printenv.pl
[Mon May 29 20:51:05 2006] [error] [client 127.0.0.1]
attempt to invoke directory as script: C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/

Also the browser pops out a small window and asks if I
want to download this script? ( this script is
actually on my computer but not from the wetsite)

What is goining on here? Any help is appreciated.

Li

What is going on here?

________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Eric Martin

2006-06-01, 3:55 am

Chen Li wrote:
> Dear all,
>
> I just install apache 2.2 on my Windows XP using all
> the default settings. I run the printenv.pl script
> from Apache. I change the first line of the script to
> #!c:\Perl\bin\perl.exe (or
> #!c:/Perl/bin/perl.exe ) get this information
>
> [client 127.0.0.1] (OS 2)The system cannot find the
> file specified. : couldn't create child process:
> 720002: printenv.pl
> [Mon May 29 20:39:18 2006] [error] [client 127.0.0.1]
> (OS 2)The system cannot find the file specified. :
> couldn't spawn child process: C:/Program Files/Apache
> Software Foundation/Apache2.2/cgi-bin/printenv.pl
> [Mon May 29 20:51:05 2006] [error] [client 127.0.0.1]
> attempt to invoke directory as script: C:/Program
> Files/Apache Software Foundation/Apache2.2/cgi-bin/
>
> Also the browser pops out a small window and asks if I
> want to download this script? ( this script is
> actually on my computer but not from the wetsite)
>
> What is goining on here? Any help is appreciated.


This error occurs when the shebang line is incorrect.

I am running apache 2.0.54 on WinXP with ActivePerl 5.8 installed in
C:\Perl. The following shebang lines all work for me:
#!perl
#!c:\perl\bin\perl.exe
#!c:/perl/bin/perl.exe

So, double check the location of your perl.exe file. You can also add
the c:\perl\bin directory to your Path to use #!perl.

HTH

Thanks,
Eric

>
> Li
>
> What is going on here?
>
> ________________________________________
__________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

Kenneth Tomiak

2006-06-01, 7:55 am

It sounds like the default sttings are not sufficient. Go over to the apache
forums and find out how to install and CONFIGURE apache. On my Windows/XP
using IIS configuration I had to do some configuration steps. The defaults
know nothing about perl and you must perform some actions.


"Eric Martin" <emartin24@gmail.com> wrote in message
news:l92dnfMdXLks7ePZnZ2dnUVZ_tmdnZ2d@st
arstream.net...[color=darkred]
> Chen Li wrote:
>
> This error occurs when the shebang line is incorrect.
>
> I am running apache 2.0.54 on WinXP with ActivePerl 5.8 installed in
> C:\Perl. The following shebang lines all work for me:
> #!perl
> #!c:\perl\bin\perl.exe
> #!c:/perl/bin/perl.exe
>
> So, double check the location of your perl.exe file. You can also add the
> c:\perl\bin directory to your Path to use #!perl.
>
> HTH
>
> Thanks,
> Eric
>


Eric Martin

2006-06-01, 6:55 pm

Kenneth Tomiak wrote:
> It sounds like the default sttings are not sufficient. Go over to the apache
> forums and find out how to install and CONFIGURE apache. On my Windows/XP
> using IIS configuration I had to do some configuration steps. The defaults
> know nothing about perl and you must perform some actions.
>


IIS does require some setup, but Apache2 should run Perl scripts out of
the box....

Eric

>
> "Eric Martin" <emartin24@gmail.com> wrote in message
> news:l92dnfMdXLks7ePZnZ2dnUVZ_tmdnZ2d@st
arstream.net...
>
>

Kenneth Tomiak

2006-06-02, 9:55 pm


On IIS, when it doesn't know to invoke perl you get the condition you
describe. Since you think it should work, then it must be working. Therefore
you have no problem. If you still think the results are not what you want
and think you have a problem, it is not with the perl code, it is with your
Apache and operating system configuration. The forums that offer help
setting up operating systems and web servers will be a better source for
you.



"Eric Martin" <emartin24@gmail.com> wrote in message
news:JcmdnTK_lqX8heLZnZ2dnUVZ_sednZ2d@st
arstream.net...[color=darkred]
> Kenneth Tomiak wrote:
>
> IIS does require some setup, but Apache2 should run Perl scripts out of
> the box....
>
> Eric
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com