|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I'm trying to learn PERL/CGI but i can't get it to work under Apache 1.3.14.[under windows 98 and activeperl]. I've changed the directory i wanted to run it in under options like so
<Directory "C:/windows/desktop/webpages"> Options ALL +MultiViews AllowOverride None Order allow,deny Allow from all </Directory> That lets me excute cgi scripts under the directory but i keep getting a 500 error. It seems like, atleast to me, that the server can't find perl.exe. My root working directory for apache is the directory you see above but perl is in c:\perl\ could that be a problem? Also i changed the following:: ================== # can execute this specific script. For a perl script, with perl.exe in # the C:\Program Files\Perl directory, the shebang line should be: #!C:\Perl\bin\perl.exe ================= which i also add it to the file. The file works fine when i run it from the command line. Is there anything else i need to change in my httpd.conf? p.s i also added this ======= AddHandler cgi-script .cgi AddHandler cgi-script .pl ======= Any help would be appreciated ![]() Thanks, Cisk |
|
#2
|
|||
|
|||
|
Create a ScriptAlias for your cgi-bin directory, like so:
ScriptAlias /perl-bin/ "C:/path to/your/perlscripts" And also make sure that your perl script is not the one casuing the server error. If you are sending output to the browser, remember to set the outgoing Content-Type header to text/html like so: # set the content type headers to text/html along with # the required two 'newlines', i.e. "\n\n"; print "Content-Type: text/html\n\n"; # HTML print statements And of course, check the server error_log files for hints of why your are getting the 500 Server Error message. good luck -Carlos |
|
#3
|
|||
|
|||
|
Thanks carlos,
I tried adding: ScriptAlias /perl-bin/ "C:/path to/your/perlscripts" but it did not work. I also have: print "Content-Type: text/html\n\n"; on top and it still outputs an error. I checked my error logs and this is what i get: [Wed Feb 28 16:55:21 2001] [error] [client 127.0.0.1] couldn't spawn child process: :/windows/desktop/webpages/test.pl [Wed Feb 28 16:55:24 2001] [error] [client 127.0.0.1] couldn't spawn child process: :/windows/desktop/webpages/test.cgi the perl code is only print "hello"; So it can't be the code not working, i don't know what else to do. I can run it find using "perl.exe test.pl" but i would like it to work with apache. any ideas? Cisk |
|
#4
|
|||
|
|||
|
Well it finally works.
I chaged #!c:\Perl\bin\ to #!c:\Perl\bin\perl and it works. I didn't think of changing that because i had already tried changing it a few times with no luck but the print "Content-Type: text/html\n\n"; is what did the trick!!!!!!!! Thanks a lot Carlos ![]() Cisco |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > CGI/PERL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|