Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi/ssi enabeling.

Status
Not open for further replies.

WintersMystic

Programmer
Aug 8, 2001
39
0
0
US
i just got Apache 1.3.22 installed. now i want to get CGI working. i changed the httpd.conf file apropriately. but i still get a 500 error. so, do i need to install perl from activestate?

here is what is in the error.log

[Wed Jan 23 17:00:06 2002] [error] [client 127.0.0.1] couldn't spawn child process: c:/program files/apache group/apache/cgi-bin/printenv.cgi

and this is what i have in the file

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "Hello";
 
Yes download the msi installer if you don't have it already then the .msi distro of perl. You will also need to edit the top line in your scrips to show the correct path to perl. i.e. #!c:/perl/bin/perl.exe.
 
Hi,

Sorry to hijack your thread WinterMystic but I am having exactly the same problem!

Could you tell us RhythmAce where to download both the MSI intaller (Microsoft.com I guess) and the .msi distrobution of Perl?

Thanks,

RC
 
Hi,

The .msi for 1.3.22 is here -->
ActivePerl can be downloaded here -->
There is a difference between linux / unix and win32 in the way cgi extensions work. With Linux if a file is identified under apache as a 'cgi-script' (in the usual way with AddHandler) then a process is spawned to run that script. However, other than causing it to be identfied as cgi, once the spawning happens the file extension has no meaning because the 'shebang' (first line of file - #!/usr/local/bin/perl - or suchlike) is read and that path used. So, for example, you can put perl scripts in files with any extension you like, e.g. mycgi.abc . Or, a file called mycgi.pl could contain a bash script instead of perl.

On win32 itself, however, the 'shebang' doesn't operate and you must have the extensions associated with perl. On win32 if you have a perl script called abc.cgi and .cgi is not associated with the perl interpreter then, traditionally, it won't run. So you may have to give your scripts the .pl extension. However, nowadays, you are supposed to be able to use the shebang under win32 via some extra code that apache uses - you must put the correct path to the perl executable however. If in doubt just use .pl extensions.

Hope thats not too confusing - see -->
Regards
 
Hi,

Sorry to hijack your thread WinterMystic but I am having exactly the same problem!

Could you tell us RhythmAce where to download both the MSI intaller (Microsoft.com I guess) and the .msi distrobution of Perl?

Thanks,

RC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top