> -----Original Message-----
> From: Randy Kobes [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 23, 2005 05:31 PM
> To: 'Bennett Haselton'
> Cc: perl-win32-users@listserv.ActiveState.com
> Subject: Re: error in DynaLoader.pm loading DLL on (some) machines
> 
> On Mon, 23 May 2005, Bennett Haselton wrote:
> 
> > I have a Perl script installed on my XP Pro Sp2 machine
> > with ActivePerl 5.8.3 build 809, that uses Net::SSLeay
> > version 1.25 to download https URLs, and works fine.  I
> > also have the Web server OpenSA 2.0.2 which runs some CGI
> > scripts that use Net::SSLeay to fetch content from
> > third-party https sites and those work too.
> >
> > However, a friend of mine has installed the same script on
> > his machine where he has the exact same version of Perl,
> > the exact same version of OpenSA, and the exact same
> > version of Net::SSLeay installed, and is seeing this odd
> > behavior:
> >
> > 1) If he has this script:
> >  >>>
> > #!c:/perl/bin/perl.exe
> >
> > eval { require Net::SSLeay } ;
> > if ($@)
> > {
> >     print "Yes: [EMAIL PROTECTED]";
> > }
> > else
> > {
> >     print "No.\n";
> > }
> >  >>>
> > in a file named nph-test.cgi and runs it from the command line with the
> > command "perl nph-test.cgi", it outputs "No."  (That is, the "require
> > Net::SSLeay" statement runs with no problem.)
> >
> > 2) BUT, if he loads the same script in a Web browser from the cgi-bin
> > directory of OpenSA, it outputs:
> >  >>>
> > Yes: Can't load 'C:/Perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for
> > module Net::SSLeay: load_file:The specified module could not be found
> > at C:/Perl/lib/DynaLoader.pm line 229.
> >   at C:/OpenSA/Apache2/cgi-bin/nph-test.cgi line 3
> > Compilation failed in require at C:/OpenSA/Apache2/cgi-bin/nph-test.cgi
> > line 3.
> >  >>>
> > (Note, the file C:/Perl/site/lib/auto/Net/SSLeay/SSLeay.dll *does* exist on
> > his machine.)
> >
> > 3) On my machine the script works fine (i.e. outputs "No", indicating no
> > error loading Net::SSLeay) when run from the command line OR loaded via the
> > Web server.
> >
> > Any idea why this error would happen only when the script is run through
> > the Web server, and why it would happen only on one machine but not
> > another?
> 
> That error is probably slightly misleading - it can result
> from Net::SSLeay not finding the ssl dlls (libeay32.dll
> and/or ssleay32.dll). Try adjusting the PATH environment
> variable to include the directory where these dlls live (eg,
> Apache has a SetEnv directive for doing such things). You'll
> also have to ensure that the permissions on the directories
> where the dlls are located are such that the dlls are
> loadable by the user that the web server is running as.

Randy,

Thanks for the tips.  The PATH environment variable on the machine actually 
does already include the c:\OpenSA\Apache2\bin directory containing 
libeay32.dll and ssleay32.dll, but yes I wonder if it's something to do with 
Apache.exe running under a different user.  It's running as the user SYSTEM.

Is there a way that I can run the Perl script from the command line "as" the 
user SYSTEM, to see if it encounters the same error?  I was going to have him do
runas /user:SYSTEM perl nph-test.cgi

However, if you do that, you get prompted for the password for the built-in 
SYSTEM account, which I believe is not normally accessible to the user.  Is 
there any other way to run it as "SYSTEM"?

-Bennett
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to