phporacle-databasewindows-7php-5.6

php_oci8_11g.dll is not a valid Win32 application


This topic has been asked several times, but every solution is not working in my machine.

I am trying to connect windows 7 with a 10G oracle dabatase, but the oci extension is not loaded. Here some facts:

C:\php>php -m

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_oci8_11g.dll' - %1 is not a valid Win32 application.

C:\php>php -v

PHP 5.6.19 (cli) (built: Mar  2 2016 20:09:42)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

C:\>tnsping localdb

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 02-AUG-2
016 22:37:50

Troubleshooting

What other thing am I missing? Thank you in advance


Solution

  • After months I found the solution. Consider the following infrastructure:

    Take close attention when downloading Oracle Instant Client:

    Both details are very important. Once I meet both requirements the error has gone I now I am able to connect to Oracle via PHP successfully