OK, so I uninstalled Apache 64 bits, and installed Apache 32 bits instead.

Now, Apache starts correctly with the following two lines in httpd.conf

----------------
LoadFile "C:/Perl/bin/perl512.dll"
LoadModule perl_module modules/mod_perl.so
----------------

Only problem is that my scripts still seem to run under the conventional CGI 
interface, instead of mod_perl. For example, if I run this script:

----------------
#!C:/Perl/bin/perl

print "Content-type: text/plain\r\n\r\n";

print "Server's gateway interface:\t$ENV{GATEWAY_INTERFACE}\n\n";

print "Other values of the server environment:\n";
foreach my $a_key ( keys %ENV ) {
    print "$a_key:\t$ENV{$a_key}\n";
}
------------------

I get "Server's gateway interface:      CGI/1.1", and according to this page:

http://perl.apache.org/docs/1.0/guide/install.html#Testing_via_a_CGI_script

this means I am NOT running mod_perl. If I WAS running mod_perl, I should be 
seeing something like 'CGI-Perl/1.1' instead.

Note that I saw the following line in httpd.conf

---------------
LoadModule cgi_module modules/mod_cgi.so
---------------

I tried commenting it out, thinking that maybe this was overriding mod_perl. 
But when I do that, my scripts don't run as a perl script anymore. Instead, the 
source code of the scripts is displayed in the browser when I try to invoke it.

I have looked through all the documentation I could find about installing 
mod_perl for windows, and I can't find any additional step beyond the ones I 
have taken so far. 

Any suggestions you have will be greatly appreciated.

Thx.

Alain Désilets


-----Original Message-----
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Tuesday, November 29, 2011 10:48 AM
To: mod_perl list
Subject: Re: Installing mod_perl on Windows 7

Desilets, Alain wrote:
> Hi folks,
> 
> This is my first post on this list.
> 
> I am trying to install mod_perl on Windows 7, and am running into some 
> problems.
> 
> Here's what I did.
> 
> First, I ran the following commands to get the mod_perl package and install 
> it:
> 
> ----------------
> ppm rep add http://cpan.uwinnipeg.ca/PPMPackages/12xx
> ppm install mod_perl
> ----------------
> 
> Then I added the following lines at the start of my httpd.conf file:
> 
> ----------------
> LoadFile "C:/Perl/bin/perl512.dll"
> LoadModule perl_module modules/mod_perl.so
> ----------------
> 
> But since then, Apache won't restart,  unless I comment out those two lines. 
> To diagnose the problem, I ran the command:
> 
> ----------------
> httpd.exe -t -c httpd.conf
> ----------------
> 
> And it gives me the following error message:
> 
> ----------------
> httpd: Syntax error on line 29 of 
> C:/wamp/bin/apache/Apache2.2.17/conf/httpd.conf: Cannot load 
> C:/Perl/bin/perl512.dll into server: %1 is not a valid Win32 application.
> ----------------
> 
> The file C:/Perl/bin/perl512.dll does exist.
> 
> I am wondering if the problem is not due to a difference between 32 and 64 
> bits applications. I ran a small perl script which looks at the DOS headers 
> of executables, to find the architecture that the executable was compiled 
> for, and here's what it tells me:
> 
> httpd.exe: AMD64
> perl512.dll: i386
> mod_perl.so: i386
> 
> I would think that a 64 Apache is able to load a 32 bit DLL, no?
No.
> 
> Does anyone have some ideas or suggestions?

a 64-bit Windows can run 32 and 64 applications.  But within an application, 
you cannot 
mix and match.
So either get a 64-bit perl and mod_perl, or get a 32-bit Apache.
I would suggest a 32-bit Apache, as for a workstation, you are unlikely to need 
the extra 
memory that 64-bit would allow you to use; and your 32-bit applications will 
use less 
memory in vain.


Reply via email to