简体   繁体   中英

Connecting php to oracle database

I am trying to connect to a oracle database that is not installed locally but i am getting a lot of errors. I had windows 8 and easyphp installed , I unchecked extensions for oracle connection(php_oci8, and the other one, similar to this) but i received the message:

Call to undefined function oci_connect().

and when i start php it gives me an error

The procedure entry point OCILobRead2 could not be located in the dynamic link library ...php_oci8.dll

Then after reading some on the internet i saw that i have to install oracle database or oracle instantclient. Installed both, oracle database 11g2 didn't work( i guess it's because of my windows 8), oracle database 12 did install but then i couldn't do anything and i still have the message. Then, before installing i find an online document that suggested installing xamp 1.7.3 and oracle instant client. Did so, set my enviroment path to instant client but still nothing happened...still getting the same errors as above.

Also tried another functions like ocilogon(which is depreciated) but i receive the same error.Any help would be apreciated.

You need to make sure that in your PHP directory you have php_oci8.dll for your version of PHP and then make sure it's listed in your php.ini file. There's also an important note on the PHP site about this. http://www.php.net/manual/en/oci8.requirements.php

On Windows, the php_oci8 DLL needs Oracle client libraries from version 10gR2 or greater. In PHP 5.3 up to and including PHP 5.3.5, the php_oci8_11g DLL requires Oracle 11gR1 or greater client libraries. From PHP 5.3.6 the php_oci8_11g DLL requires Oracle 11gR2 or greater client libraries. The php_oci8_12c DLL from PECL requires Oracle 12cR1 client libraries. With some versions of Instant Client you may additionally need mfc71.dll and msvcr71.dll libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM