简体   繁体   中英

Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\Project1\connect.php on line 3

I am trying to connect to a 9i oracle database using XAMPP Version 5.6.15.

After a few days of struggling with this I uninstalled XAMPP and just installed PHP and Apache HTPPD.

Verified PHP and HTTP were working and again got the EXACT SAME ERROR. So I reinstalled XAMPP The underlying issue I know is that is cant load C:\\xampp\\php\\ext\\php_oci8.dll .

I am sure the correct .ini file is being picked up and the extension_dir is defined correctly and I have included the file php_oci8.dll in that directory.

In desperation I downloaded the oracle instant client 10 holding all of those dlls and added them under the php directory. This directory along with the PHP one has been added to PATH in my system variables so all required DLLs should be getting picked up.

After all of this I am still getting the above error. Has anyone any other ideas to try? Any help would be greatly appreciated - am pulling my hair out for the guts of a week on this one.

Finally got to the bottom of this. I had to go back to version 1.8.2. of XAMPP Installed that. This version does not even reference php_oci8_12c.dll which is just fine because who needs it if it is a 9i database you are trying to access. You need to uncomment the php_oci8.dll in php.ini. I kicked off Appache under XAMPP and got an error about not being able to load certain dlls. To fix this you need to install the instantclient_10_2 which you can pull from the Oracle site. I dont think it matters but I installed it under the PHP directory under xampp. Just be sure to reference this FIRST in your PATH environment variable along with the ext directory. And hopefully its viola as opposed to me pulling my hair out for a solid week to get to this point.

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