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
6
  • 1
    Possible duplicate of Stuck Call to undefined function oci_connect() using XAMPP Commented Aug 26, 2019 at 7:09
  • Try this Call to undefined function oci_connect, php_oci8_12c.dll, windows 8.1, php5.6.6 Commented Aug 26, 2019 at 7:15
  • @HussamAdil Windows 10 Pro Commented Aug 26, 2019 at 7: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. Commented Aug 26, 2019 at 7:18
  • @HussamAdil I have attempted the suggestions in the link you provided but the error still persists. Commented Aug 26, 2019 at 11:08

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

5 Comments

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.
what about oracle client? here you can find latest dll for php : windows.php.net/downloads/pecl/releases/oci8/2.1.8 go for TS (thread safe) version!
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.
after enable/disable the oci8 library - restart the server! use only x64 or only x86 versions, otherwise the connect will not be established
Thank you! I tried restarting it again after making the above changes. It seems to work now !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.