0

I've been trying to connect the oracle SQL Database for my PHP Project. I have followed along the steps listed online as well as tried following along with this tutorial.

I have tried:

  • Installing appropriate Instant Client version 12.1 and adding to system PATH
  • Un-commented the line relating the oracle database in php.ini
  • Downloading and replacing the DLL files under xampp/php/ext with the ones from PECL

This still showed an "oci_connect()" could not be recognized.

Versions

OS Version: Windows 10 Pro

XAMPP: x64

PHP version: 7.2.12 Architecture: x86

Instant Client: x64 (Tried with x86 as well but no difference)

However, I have not been able to troubleshoot and despite the above attempts the "oci_connect()" function doesn't get recognized. Any help or guidance will be appreciated.

Fatal error: Uncaught Error: Call to undefined function oci_connect() in C:\xampp\htdocs\test\scriptdemo.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test\scriptdemo.php on line 7
thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
Kate
  • 51
  • 1
  • 11
  • 1
    Possible duplicate of [Stuck Call to undefined function oci\_connect() using XAMPP](https://stackoverflow.com/questions/41652210/stuck-call-to-undefined-function-oci-connect-using-xampp) – Popeye Aug 26 '19 at 07:09
  • Try this [Call to undefined function oci_connect, php_oci8_12c.dll, windows 8.1, php5.6.6](https://stackoverflow.com/questions/29257894/call-to-undefined-function-oci-connect-php-oci8-12c-dll-windows-8-1-php5-6-6?noredirect=1&lq=1) – Hussam Adil Aug 26 '19 at 07:15
  • @HussamAdil Windows 10 Pro – Kate Aug 26 '19 at 07:16
  • @Tejash I have tried the suggestions listed in that thread already including copying the files to xampp/apache/bin folder as well as uncommenting extension_dir = "./". Both have not worked. – Kate Aug 26 '19 at 07:18
  • @HussamAdil I have attempted the suggestions in the link you provided but the error still persists. – Kate Aug 26 '19 at 11:08
  • If anyone one is stuck, check out [Installing XAMPP on Windows for PHP and Oracle Database](https://blogs.oracle.com/opal/installing-xampp-for-php-and-oracle-database) – Christopher Jones Sep 01 '19 at 10:19

1 Answers1

1

the xampp runs on x86 or x64 version? an the oracle client should be in sync with xampp - same version!

t v
  • 199
  • 1
  • 11
  • XAMPP Runs on x64..the PHP version is x86 architecture. I have tried with both x86 and x64 instant client versions but the error is the same. When I check the phpinfo(), it is supposed to show a section for oci8 as well which doesn't display at all. – Kate Aug 26 '19 at 11:07
  • what about oracle client? here you can find latest dll for php : https://windows.php.net/downloads/pecl/releases/oci8/2.1.8/ go for TS (thread safe) version! – t v Aug 26 '19 at 11:15
  • You mean the oracle Instant Client? I have tried using bot x86 and x64 versions. The ones I have tried are: x86 Basic Lite 12.2.0.1.0, x64 Basic 12.1.0.2.0 , x64 Basic 19.3.0.0. None of these seem to fix the problem. – Kate Aug 26 '19 at 11:16
  • after enable/disable the oci8 library - restart the server! use only x64 or only x86 versions, otherwise the connect will not be established – t v Aug 26 '19 at 11:21
  • Thank you! I tried restarting it again after making the above changes. It seems to work now ! – Kate Aug 26 '19 at 11:25