Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php: loading oracle driver gives error "Unable to load dynamic library - The specified procedure could not be found."

Tags:

php

oracle

pdo

dll

I seem to have a strange problem with PHP.

I've migrated a bunch of software from one server to another. On the server some scripts make a connection to Oracle, so to be able to make a connection the oracle client is installed and a tnsnames file is in place. Connection from sql*plus works.

Some of the scripts use PDO, so for that I've enabled extension=php_pdo_oci.dll in php.ini. These scripts work like a charm.

Some other scripts use functions like oci_connect, and these need a extension like php_oci8.dll. With xammp (that I use as apache/php/mysql bundle) php_oci8_12c.dll is delivered, so I thought that extension would be adequate.

When starting the server, I see these errors in the php errorlog:

Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified procedure could not be found.

The file is in located in C:\xampp\php\ext\, so that shouldn't be a problem. Other extensions that are in the same dir are picked up without any problems. I've also tried to load php_oci8.dll, wich I picked up from the old server, but got exactly the same problem.

Some answers I found to similar problems I tried without success: - copying the dll to c:\windows\system - adding the php ext dir to the system PATH variable - adding the oracle client to the system PATH variable (was already in there)

The software versions I'm using:

  • OS: Windows 2012 R2 x64
  • PHP: 5.6.3
  • Oracle database: 11.2.0.4.0

Any ideas?

like image 811
ErikL Avatar asked Mar 15 '23 18:03

ErikL


1 Answers

Seems like I figured it out and can answer my own question. It looks like XAMPP is delivering a non-suitable ddl with their distribution. The right and most recent oci8 dll's are downloadable here in all possible flavors: http://windows.php.net/downloads/pecl/releases/oci8/2.0.8/. Once I got the right one, it worked like a charm.

like image 58
ErikL Avatar answered Mar 18 '23 13:03

ErikL