Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 10th, 2001, 09:18 PM
devCisk devCisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 29 devCisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

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

Reply With Quote
  #2  
Old February 16th, 2001, 07:06 PM
carlos carlos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 11 carlos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old February 28th, 2001, 05:02 PM
devCisk devCisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 29 devCisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

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

Reply With Quote
  #4  
Old February 28th, 2001, 05:17 PM
devCisk devCisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 29 devCisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > CGI/PERL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway