Skip to content

Instantly share code, notes, and snippets.

@odan
Last active November 13, 2020 20:03
Show Gist options
  • Star 38 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save odan/4edb46a44721f2ef3bdefe2ea999e2e8 to your computer and use it in GitHub Desktop.
Save odan/4edb46a44721f2ef3bdefe2ea999e2e8 to your computer and use it in GitHub Desktop.
XAMPP - Oracle Driver Setup (v12)
@PhouvanhKCSV
Copy link

on XAMPP 3.2.2, PHP 7.1.8
still get "Fatal error: Uncaught PDOException: could not find driver"

"oci_connect not found"

@tonlam
Copy link

tonlam commented Sep 24, 2017

Warning: PHP Startup: Unable to load dynamic library 'E:\BI\xampp\php\ext\php_oci8_12c.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
Extension 'oci8' not present.

Got this error. It doesn't work for me

@odan
Copy link
Author

odan commented Dec 23, 2017

It is important to copy the *.dll files twice.

  1. To c:\xampp\php
  2. To c:\xampp\apache\bin

If it's still not working then try to install the Microsoft Visual C++ Redistributable for Visual Studio

PHP 5.6

  • The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed

PHP 7.0.x, 7.1.x

  • The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed

PHP 7.2.x

  • The VC15 builds require to have the Visual C++ Redistributable for Visual Studio 2017 x64 or x86 installed

@PhouvanhKCSV @tonlam

@cytsunny
Copy link

I followed the guide and it stills says MSVCP112.dll missing.
Even trying to download Miscrosoft Visual C++ Redistributable for Visual Stuiod is not helping.

I am using XAMPP on Windows8 with PHP 5.6.

Finally I download and install the vcredist_x86 and it solves the problem. Yes, my system is x64, but I carelessly downloaded x86 but still somehow solves the problem. You may try to download x64 first to see if that solves the problem and try x86 if you are in simular situation as me. See if there are anyone can explain why.
https://support.microsoft.com/en-us/help/3179560

And this guide is really helpful. Starred.

@jreid101
Copy link

It worked perfectly for me, thanks for the help!

@marslankhalid
Copy link

marslankhalid commented Mar 30, 2018

I tried but it's still not working.
ERROR
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: C:\xampp\php\ext\oci8_12c (The specified module could not be found.
), C:\xampp\php\ext\php_oci8_12c.dll (%1 is not a valid Win32 application.
)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: C:\xampp\php\ext\oci8_12c (The specified module could not be found.
), C:\xampp\php\ext\php_oci8_12c.dll (%1 is not a valid Win32 application.
)) in Unknown on line 0

@waqas-mehmood-pk
Copy link

I have following environments:

  1. Windows 10 64 bit
    image
  2. Xampp:
    image
  3. Php v7.2.4
    image
  4. Oracle Instant client download, extract and set ENV_VARIABLE (i have tried with 32bit and 64bit)
    image
  5. Copy all *.dll files from oracle instant client folder to c:\xampp\php and c:\xampp\php\ext.
  6. File c:\xampp\php\ext\php_oci8_12c.dll exists.
  7. Enable php extension in php.ini: extension=oci8_12c
  8. Restart the xampp.

but still getting the warning and oci8 extension not enabled. (verify from php_info.php)
image

@dwityaPrawira
Copy link

thank you.. tested and worked

@i44
Copy link

i44 commented Jun 26, 2018

Uninstalled existing XAMPP and followed the procedure. Working like a charm :) Thanks a ton !

Copy link

ghost commented Jul 4, 2018

Amazing! It worked fine to me too!!!!

@potasiyam
Copy link

Thanks a lot. It was the most straight forward way.

@Alfy-M
Copy link

Alfy-M commented Jul 19, 2018

Great guide!

@dahohawley
Copy link

thanks a lot. it works

@armyofda12mnkeys
Copy link

armyofda12mnkeys commented Oct 19, 2018

You say on a 64 bit computer, need to install both the 32 and 64 versions of instant-client...
If you unzip both the 32 and 64 bit instant-clients (so 2 different folders, one for 32, one for 64)...
and then try to copy the .dll's to the php/apache folders... I first copied the 32bit files, then tried the 64bit files...
but it asks to overwrite the oci.dll file (and a few other files)... Should I?
Maybe the 64bit client includes some needed 32bit files and i should only install that one and copy over those .dlls?
I mean like the 64bit client includes ociw32.dll alongside oci.dll

Right now Im running 64bit apache with 64bit php... so i copied the 64bit instant-client dll's over.
Also Im guessing this 'copy .dlls' step maybe doesn't need to happen if you just include the instant-client folder onto the windows PATH?
Going to try that later to see.

@adelcarpiofirteccom
Copy link

It is important to copy the *.dll files twice.

  1. To c:\xampp\php
  2. To c:\xampp\apache\bin

If it's still not working then try to install the Microsoft Visual C++ Redistributable for Visual Studio

PHP 5.6

  • The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed

PHP 7.0.x, 7.1.x

  • The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed

PHP 7.2.x

  • The VC15 builds require to have the Visual C++ Redistributable for Visual Studio 2017 x64 or x86 installed

@PhouvanhKCSV @tonlam

Thanks a lot!!!! Works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment