Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 584 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 45 Data Integration
- 45 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 666 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
php_oci8_11g.dll -- Fatal error: Call to undefined function oci_connect()
Hi,
i am currently dealing with a weird issue,
I am trying to connect to an Oracle database using the "instantclient_11_1" with windows/PHP Version 5.2.3 (under apache)
I have uncommented the extension=php_oci8_11g.dll in the php.ini
I have set the windows path
PATH ---> C:\instantclient_11_1
PHPRC ---> C:\PHP
TNS_ADMIN -----> C:\instantclient_11_1
The server have been restarted also
The php_oci8_11g.dll will also not load into the phpinfo();
Any idea what could cause the problem??
I have been looking on this for 2 days... i am quite anxious to find a solution, its a show stopper for my project.
Help would be greatly appreciated.
Thanks,
M
Edited by: user9344961 on Mar 26, 2010 11:35 AM
i am currently dealing with a weird issue,
I am trying to connect to an Oracle database using the "instantclient_11_1" with windows/PHP Version 5.2.3 (under apache)
I have uncommented the extension=php_oci8_11g.dll in the php.ini
I have set the windows path
PATH ---> C:\instantclient_11_1
PHPRC ---> C:\PHP
TNS_ADMIN -----> C:\instantclient_11_1
The server have been restarted also
The php_oci8_11g.dll will also not load into the phpinfo();
Any idea what could cause the problem??
I have been looking on this for 2 days... i am quite anxious to find a solution, its a show stopper for my project.
Help would be greatly appreciated.
Thanks,
M
Edited by: user9344961 on Mar 26, 2010 11:35 AM
Answers
-
Does phpinfo() show the correct php.ini being loaded?
What is in the Apache error log?
Do you have any other Oracle libraries on the machine that are causing a clash?
Where are you setting the variables?
Have you used a tool like Dependency Walker to check the php_oci8_11g.dll can
find the libraries it requires? -
Hi cJ2,
thanks for the reply.
the correct php.ini being loaded, when i uncomment ;extension=php_oci8.dll , it shows in phpinfo()
Regarding the Apache error log, it was a good call, I noticed the error below in the log.
Error:
PHP Warning: PHP Startup: Unable to load dynamic library './ext/php_oci8_11g.dll' - The specified procedure could not be found. in Unknown on line 0
There was an older Oracle instant client(Oracleinstantclient), but i renamed the folder.
And i made sure to comment extension=php_oci8.dll when using php_oci8_11g.dll
As for the variables, do you mean the windows variables? if so, they were set in the system variables.
I used Dependency Walker to check the php_oci8_11g.dll, i have an error on a DWMAPI.dll , is that file actually required??
Thanks for your help, its greatly appreciated!!!
M
Edited by: Elquesto on Mar 29, 2010 4:34 AM
Edited by: Elquesto on Mar 29, 2010 4:34 AM -
If php_oci8.dl works but php_oci8_11g.dll doesn't then I expect Windows is
loading Oracle 10g libraries which don't have all the symbols needed by the
11g compatible php_oci8_11g.dll library.
I vaguely recall something quirky with Windows/Apache with renaming folders containing
libraries. Did you triple check your path? Did you reboot? -
Thanks for your help cj2, i finally went back to the php_oci8.dl. The organization will go from scratch on a new server and upgrade the technologies at the same time instead of trying to integrate it to an existing server.
The dev server had php_oci8_11g.dll and the production had php_oci8.dl.
I had triple checked the path and rebooted. i should of deleted the old libraries, its pretty much the only thing i did not do.
Thanks again for your help,
Its appreciated
PS: I might reappear in a few weeks
M -
I was struggling to get the oci extensions running in PHP on IIS 7.5 on Windows 2008 R2. After about 10 hours, here was my solution:
Download the 32-bit Oracle Instant Client and put it somewhere useful (I put it under my php directory). Add it to your system's PATH.
http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html
Edit your php.ini and uncomment extension=php_oci8_11g.dll
After this, it was running fine under the CLI. With the command php -m, I would see the oci8 module listed. IIS, however, still did not show OCI8 under phpinfo and would throw the undefined function error. So I added the instant client folder to my php path under IIS and OCI8 showed up under phpinfo and IIS was able to run the Oracle commands under PHP:
1) In IIS Manager, go to your web server home and choose FastCGI Settings. Highlight the php-cgi.exe entry and choose Edit...
2) Under Environment Variables, click the box with ... to add another variable.
3) Add PATH with the Value: %PATH%;C:\php\instantclient_11_2 (where the instantclient_11_2 path is its location on your server)
4) Restart the IIS server. -
Thanks for the info - I'm sure someone will find it useful.
-
Apologies for posting to an old thread, but it was the first to come up when I googled the problem before I remembered how I've solved it before.
A quick & dirty fix on Windows is to copy all of the *.dll files from the 11g InstantClient package* into the same directory as your webserver's executable (e.g. httpd.exe). This is the first place the server looks for any dll dependencies. (*Make sure you get the correct architecture for InstantClient (32/64 bit)).
I can confirm this works with Apache httpd on Windows (haven't tested IIS). In my experience, it also works in general for any application that can't find the correct external dlls, e.g. if you have multiple versions/architectures of a library on your machine, or if you don't want to add them to PATH.
In my case (32-bit httpd), I copied:
oci.dll
ocijdbc11.dll
ociw32.dll
orannzsbb11.dll
oraocci11.dll
oraociius11.dll
to [httpd root]/bin
I'm sure you don't need all of the dlls, but it's easier to just grab them all.
HTH someone,
- Anthony
This discussion has been closed.