Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.9K Databases
- 221.6K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.9K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 400 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
PHP 7.2-Oracle connection

Hello,
having trouble to get PHP 7.2 connected to oracle, I followed the instructions shown in:
https://blogs.oracle.com/opal/installing-xampp-for-php-and-oracle-database
I think I downloaded exactly the versions of xampp and oracle-instantclient that are used there.
Still, i don't have the oci-parts shown in phpinfo.
Both php and instantclient are 32 bit (windows itself is 64 bit, but I understand that this is no problem?).
I read that the VC-version is important, must match between php and the instantclient? Is that correct?
PHP is vc15, instant-client is vc14. Could this be the cause for the problem?
unfortunately, I can't find PHP with vc14, and I can't find an instant-client with vc15.
Can anyone help?
Best Answer
-
Problem (finally) solved by installing a different oracle-client ( https://www.oracle.com/database/technologies/dotnet-utilsoft-downloads.html).
(As expected, the not-fount-error-message seems to be just a standard-message for 'something's wrong')
Answers
-
Are the oci8 libraries in the php.ini exension_dir, both for php and the xamp equivalent?
Running php from the command line the php php.ini extension_dir needs setting, as well as uncommenting or adding the relevant "extension=" for the correct version of oci8 dll for what ever version db you are trying to connect to. Also make sure you have set TNS_admin in the xamp env so the tnsnames.ora can be found.
-
Hi, Thanks for replying.
- extension dir is: C:\\xampp\php\ext
- the line in the php.ini is: extension_dir="C:\\xampp\php\ext".
I created an system-environment-variable:
TNS-ADMIN: C:\oracle\instantclient_12_2
There is a tnsnames.ora in that folder.
Starting PHP in command line, i get:
C:\xampp\php>php
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: C:\xampp\php\ext\oci8_12c (Das angegebene Modul wurde nicht gefunden.
), C:\xampp\php\ext\php_oci8_12c.dll (Das angegebene Modul wurde nicht gefunden.
)) in Unknown on line 0
As I understand, there is only one dll related to oracle (php_oci8_12c.dll). This dll does exist in C:\xampp\php\ext\.
The part "...in unknown on line 0" seems to mean that the dll is found, but there is an error inside of the dll.
Anything else I can do?
-
Hi, Thanks for replying.
You are are very welcome.
- extension dir is: C:\\xampp\php\ext- the line in the php.ini is: extension_dir="C:\\xampp\php\ext".
Why the two \'s?
I created an system-environment-variable:TNS-ADMIN: C:\oracle\instantclient_12_2
The env var needs to be "TNS_ADMIN", and underscore not a dash.
C:\xampp\php>phpPHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: C:\xampp\php\ext\oci8_12c (Das angegebene Modul wurde nicht gefunden.), C:\xampp\php\ext\php_oci8_12c.dll (Das angegebene Modul wurde nicht gefunden.)) in Unknown on line 0
Have you copied the dll to that directory?... as that is where php is expecting it according to the error message., as the English translation states "The specified module was not found."
-
Hi,
thanks again.
TNS_ADMIN, of course, not TNS-ADMIN. Unfortunately a mistake only in my post. The variable is defined correctly..
Same with extension_dir="C:\\xampp\php\ext", which of course is extension_dir="C:\xampp\php\ext"
(changing the extension_dir to an invalid path causes a much longer list of errors).
The php_oci8_12c.dll is stored in the right directory (C:\xampp\php\ext).
(To be sure, i removed php_open_ssl.dll, which I also include, from that directory, and got the cooresponding additional error when starting php)
Which means, the problem is still unsolved.
-
Problem (finally) solved by installing a different oracle-client ( https://www.oracle.com/database/technologies/dotnet-utilsoft-downloads.html).
(As expected, the not-fount-error-message seems to be just a standard-message for 'something's wrong')