views:

713

answers:

3

Hello Perl, DBD, and Oracle Masters:

I have a Perl web application that is behaving oddly. I am using it to read some stuff from an Oracle DB and report. I have version 11.1.0.6.0 of Oracle's Instant Client installed. I'm running on WinXP and have the PATH environment variable set to the instant client location. I have Apache2 for my webserver.

Here's the issue: when I run the app from a command line, it works without a hitch. However, when I run from http://127.0.0.1/cgi-bin/a.cgi, I get the following DB access error:

install_driver(Oracle) failed: Can't load 'C:/usr/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified module could not be found at C:/usr/lib/DynaLoader.pm line 202. at (eval 9) line 3

Intuition tells me it's a permission issue, but I'm not sure where to look further. Can anyone shed some light on this? I would much appreciate any help.

Thanks, Saker Ghani

+2  A: 

The fact that the error shows the full path of the .DLL suggests that the system isn't having any trouble finding the DLL, so that does back your theory that file permissions are the issue.

To test whether it really is a permissions issue, try writing a trivial Perl CGI script which does nothing but directly open that specific .DLL file (with a normal open call) and reports whether it worked or not.

Alnitak
A: 

Thanks Alnitak. I tried doing what you suggested, and 'open' successfully opened 'C:/usr/lib/auto/DBD/Oracle/Oracle.dll'. I remember seeing this exact bug when I was developing on a different machine, but that was because the Oracle Instant Client libs were mising on it. After I installed those, and set the 'Path' variable, everything started working fine.

+1  A: 

I have had the same issue, where on accessing the cgi perl program through Interface was reporting the error "Install_driver(Oracle) failed: Can't load 'C:/Perl/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:Access is denied at C:/Perl/lib/DynaLoader.pm line 201".

I was using Perl 5.10 on Window 2003 Server with IIS 6.

The resolution was to give the permissions on Perl directory to "Everyone" as well as on the Oracle Install folder.

Ronnie