Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 Problems running perl
Google
Post new topic Reply to topic
Author Message
VTS
 
 


Joined: 05 Sep 2006
Posts: 6

PostPosted: Wed Apr 04, 2007 2:11 pm Reply with quoteBack to top

Hi all,

I am having problems trying to run scripts with perl. When I create a script and try to access it via my web browser, it tries to download it instead of executing it. Is there a setting somewhere that I need to change to resolve this? I am using Apache2Triad on a windows server 2003 web edition os. Any help would greatly be appreciated.

thanks,
vts

edit -- also when I am in the apachecp and I try to run the Mod_Perl test, it give the option to save, open or cancel as well.
View user's profileSend private message
dale
 
 


Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv

PostPosted: Thu Apr 05, 2007 3:56 am Reply with quoteBack to top

It sounds like your script is named 'something.pl' and your browser doesn't know what to do with it. Try renaming your script to 'something.cgi' and see if it works.
View user's profileSend private message
VTS
 
 


Joined: 05 Sep 2006
Posts: 6

PostPosted: Thu Apr 05, 2007 2:24 pm Reply with quoteBack to top

Well I renamed it to a .cgi and instead of it trying to download the file, it gave me an apache error.

It says:

Server Error!

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

Error message:
couldn't create child process: 720003: copy.cgi

error 500

I can run the perl script in my perl editor without any problems and it does what it is supposed to. Any ideas what would cause this?
View user's profileSend private message
dale
 
 


Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv

PostPosted: Fri Apr 06, 2007 6:26 am Reply with quoteBack to top

See if you can find this line in your httpd.conf file for the apache server and uncomment it.

#LoadModule perl_module modules/mod_perl.so

Then restart the apache service and see if it works. I checked it on the server 2003 and it worked with the .pl extension too.

If it doesn't, tell me which version of apache2triad you are using.
View user's profileSend private message
unikorn
 
 


Joined: 14 Mar 2004
Posts: 5

PostPosted: Fri Apr 06, 2007 2:36 pm Reply with quoteBack to top

another thing you can try is go into your httpd.conf and near the bottom, find the cgi and the perl configuration stuff. check to see if it recognises .cgi or .pl I have mine recognising both. here is a copy of mine


#CGI (perl/python/tcl) config
LoadModule cgi_module modules/mod_cgi.so
<IfModule mod_cgi.c>
AddHandler cgi-script .cgi .pl
AddType application/x-httpd-cgi .cgi .pl
AddHandler cgi-script .py
AddType application/x-httpd-cgi .py
AddHandler cgi-script .tcl
AddType application/x-httpd-cgi .tcl
</IfModule>


#perl config
LoadFile perl\bin\perl58.dll
#LoadModule perl_module modules/mod_perl.so
<IfModule mod_perl.c>
AddHandler perl-script .pl .cgi
AddType application/x-httpd-perl .pl .cgi
PerlOptions ParseHeaders
PerlHandler ModPerl::Registry
PerlSendHeader On
</IfModule>

also check to make sure you have the right path to the perl on the top line in the script file. ie: #!C:/www/perl/bin/perl.exe
View user's profileSend private message
VTS
 
 


Joined: 05 Sep 2006
Posts: 6

PostPosted: Fri Apr 06, 2007 4:34 pm Reply with quoteBack to top

Well it looks like my problem was pretty simple after all. I noticed at the top of my perl script that I have misspelled apache......Now it seems to be doing ok. All I gotta do now is figure out how to properly write my script Smile

thanks for the info guys
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT