Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Problem getting the sample perl script to run on the apache http server

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


chintankachhi at gmail

Jul 1, 2009, 11:36 AM

Post #1 of 3 (391 views)
Permalink
Problem getting the sample perl script to run on the apache http server

Hello,
I just installed apache http server version 2.2 on my local machine. I
copied a sample hello world perl script under the cgi-bin directory of the
Apache installation folder and named it first.pl. When I put
http://hostnamein the web browser url, it shows that the server is
installed, since it
displays the message, '*It works!'. *However when I try to run the script
typing the following in the browser: http://hostname/cgi-bin/first.pl , it
gives me the error: 500 Internal Server ErrorInternal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, admin [at] hostnam and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.


Looking through the error log, it shows me the following message : [Wed Jul
01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The system cannot
find the path specified. : couldn't create child process: 720003: first.pl
[Wed Jul 01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The system
cannot find the path specified. : couldn't spawn child process: C:/Apache
Software Foundation/Apache2.2/cgi-bin/first.pl


Is there something that I am missing or doing wrong?


aw at ice-sa

Jul 1, 2009, 11:57 AM

Post #2 of 3 (353 views)
Permalink
Re: Problem getting the sample perl script to run on the apache http server [In reply to]

Chintan Kachhi wrote:
> Hello,
> I just installed apache http server version 2.2 on my local machine. I
> copied a sample hello world perl script under the cgi-bin directory of the
> Apache installation folder and named it first.pl. When I put
> http://hostnamein the web browser url, it shows that the server is
> installed, since it
> displays the message, '*It works!'. *However when I try to run the script
> typing the following in the browser: http://hostname/cgi-bin/first.pl , it
> gives me the error: 500 Internal Server ErrorInternal Server Error
>
> The server encountered an internal error or misconfiguration and was unable
> to complete your request.
>
> Please contact the server administrator, admin [at] hostnam and inform them of
> the time the error occurred, and anything you might have done that may have
> caused the error.

So, have you done that ?
;-)
(*)
>
> More information about this error may be available in the server error log.
>
>
> Looking through the error log, it shows me the following message : [Wed Jul
> 01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The system cannot
> find the path specified. : couldn't create child process: 720003: first.pl
> [Wed Jul 01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The system
> cannot find the path specified. : couldn't spawn child process: C:/Apache
> Software Foundation/Apache2.2/cgi-bin/first.pl
>
Aha, so it is Windows !

>
> Is there something that I am missing or doing wrong?
>
What you did above was correct, but maybe you are missing this part :

1) did you install perl on that machine ?
If not, download and install from here :
http://www.activestate.com/activeperl/
2) if/when you installed perl, make sure that the first line of your
script looks like :
#!c:/perl/bin/perl.exe
(or wherever perl.exe is)

then try again.

And welcome to the world of Apache + perl. It's fun. Really, you'll see.


(*) you can change that address in the Apache configuration file. Look
for "ServerAdmin".

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


chintankachhi at gmail

Jul 1, 2009, 12:13 PM

Post #3 of 3 (353 views)
Permalink
Re: Problem getting the sample perl script to run on the apache http server [In reply to]

Oops, I just realized that I had not changed the path in the perl file to
reflect the path to where my perl.exe was located.

I changed it to #!c:/Perl/bin/perl.exe
and now it works. Thanks.

On Wed, Jul 1, 2009 at 1:57 PM, André Warnier <aw [at] ice-sa> wrote:

> Chintan Kachhi wrote:
>
>> Hello,
>> I just installed apache http server version 2.2 on my local machine. I
>> copied a sample hello world perl script under the cgi-bin directory of the
>> Apache installation folder and named it first.pl. When I put
>> http://hostnamein the web browser url, it shows that the server is
>> installed, since it
>> displays the message, '*It works!'. *However when I try to run the script
>> typing the following in the browser: http://hostname/cgi-bin/first.pl ,
>> it
>> gives me the error: 500 Internal Server ErrorInternal Server Error
>>
>> The server encountered an internal error or misconfiguration and was
>> unable
>> to complete your request.
>>
>> Please contact the server administrator, admin [at] hostnam and inform them
>> of
>> the time the error occurred, and anything you might have done that may
>> have
>> caused the error.
>>
>
> So, have you done that ?
> ;-)
> (*)
>
>>
>> More information about this error may be available in the server error
>> log.
>>
>>
>> Looking through the error log, it shows me the following message : [Wed
>> Jul
>> 01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The system cannot
>> find the path specified. : couldn't create child process: 720003:
>> first.pl
>> [Wed Jul 01 13:33:18 2009] [error] [client 10.184.226.251] (OS 3)The
>> system
>> cannot find the path specified. : couldn't spawn child process: C:/Apache
>> Software Foundation/Apache2.2/cgi-bin/first.pl
>>
>> Aha, so it is Windows !
>
>
>> Is there something that I am missing or doing wrong?
>>
>> What you did above was correct, but maybe you are missing this part :
>
> 1) did you install perl on that machine ?
> If not, download and install from here :
> http://www.activestate.com/activeperl/
> 2) if/when you installed perl, make sure that the first line of your script
> looks like :
> #!c:/perl/bin/perl.exe
> (or wherever perl.exe is)
>
> then try again.
>
> And welcome to the world of Apache + perl. It's fun. Really, you'll see.
>
>
> (*) you can change that address in the Apache configuration file. Look for
> "ServerAdmin".
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.