Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable oci in xampp 5.6.3?

Tags:

php

dll

xampp

oci8

I am facing some issue while starting Apache server via XAMPP. I have installed XAMPP Version 5.6.3.

When I start the Apache server from xampp control panel, an error message is displayed as shown below:

Figure-1

On clicking 'OK' button, another dialog box is displayed as shown:

Figure-2

The thing is I wanted to use OCI instead of mysql. so I have commented out the mysql extensions and uncommented the OCI extension in php.ini file.

Figure-3

The php_oci8_12c.dll file is the only file available in the extensions (ext) folder of php in xampp. Hence I included the line in the php.ini as shown in the above image.

Since then I am getting this error.

I have installed instant client 12.1 as well but no luck. I also tried copying the OCI.dll from instantclient_12_1 and pasting it in c:/xampp/php and c:/xampp/apache/bin. The error still persists.

Need help..

UPDATE: I removed other oracle paths in PATH of environment variables, keeping only the instantclient path. Now I am getting this error..

Figure-4

like image 944
Harshrossi Avatar asked Mar 12 '15 12:03

Harshrossi


People also ask

Can we use Oracle with xampp?

XAMPP is an open source package that contains Apache, PHP and many PHP 'extensions'. One of these extension is PHP OCI8 which connects to Oracle Database.


3 Answers

Well, I've installed XAMPP 1.8.2, PHP 5.4 and Apache 2.0, and I use php_oci8_11g.dll and works fine.

You are trying use php_oci8_12g.dll, I recommend you read this link http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html with especifications for run oci12g.

like image 122
Pablo Lopes Avatar answered Sep 29 '22 09:09

Pablo Lopes


I solved the issue. The problem was that I was trying to use a 64 bit DLL(php_oci8_12g.dll) in a 32 bit PHP. I downloaded a 32 bit instantClient and it works now! :-)

instantclient-basic-nt-12.1.0.2.0.zip

like image 45
Harshrossi Avatar answered Sep 29 '22 10:09

Harshrossi


I solved the issue after stuck 2-3 days .

Before follow steps Some things to remmember . 1- I am using win 8.1 64 bit . 2- Using Xampp 5.6.31 32 bit . 3- Using instaclient 12.2.0.1 64 bit (Because my win 8.1 is 64 Bit ) .

Now steps are below -

Step 1 - Download xampp 5.6.31 32 bit and install it .

Step 2 - Download and install oracle 11g R2

Step 3 - Download and install OTN (oracle instaclient 12.2.0.1 )

  • Extract all files in any drive in my case i have extract in C:\oracle\instaclient12.2.0.1
  • Add (C:\oracle\instaclient12.2.0.1 ) it to the path variables of the system. and also add new variable under variable of system with name TNS_ADMIN and put same path (C:\oracle\instaclient12.2.0.1 ) in its value .
  • Its time to set PHP.INI here uncomment following (see image below) PHP.ini setup
  • Copy 3 files from C:\oracle\instaclient12.2.0.1 oci.dll,oraociei12.dll and oraons.dll to xampp apache\bin . by this step Unable to load dynamic library issue has been resolved . Unable to load dynamic library issue solution
  • Now restart Apache on xampp and check info.php on browser . OCI8 module will appear there enable .

Enjoy !!!.

like image 44
Himanshu Dixit Avatar answered Sep 29 '22 09:09

Himanshu Dixit