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.

-- 
best regards,
randy kobes
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to