| View previous topic :: View next topic |
| Author |
Message |
VTS
Joined: 05 Sep 2006
Posts: 6
|
| Posted: Wed Apr 04, 2007 2:11 pm Post subject: Problems running perl |
|
|
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. |
|
| Back to top |
|
dale
Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv
|
| Posted: Thu Apr 05, 2007 3:56 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
VTS
Joined: 05 Sep 2006
Posts: 6
|
| Posted: Thu Apr 05, 2007 2:24 pm Post subject: |
|
|
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? |
|
| Back to top |
|
dale
Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv
|
| Posted: Fri Apr 06, 2007 6:26 am Post subject: |
|
|
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. |
|
| Back to top |
|
unikorn
Joined: 14 Mar 2004
Posts: 5
|
| Posted: Fri Apr 06, 2007 2:36 pm Post subject: |
|
|
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 |
|
| Back to top |
|
VTS
Joined: 05 Sep 2006
Posts: 6
|
| Posted: Fri Apr 06, 2007 4:34 pm Post subject: |
|
|
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 :)
thanks for the info guys |
|
| Back to top |
|
| |