Ok guys.
First use
<?php phpinfo(); ?>
and define your version of PHP (located at the very top, for example, 7.0.xxx), as well as your architecture of the version of PHP: x64 or x86, as well as Thread Safe or Not THread Safe (located in the first table as "Thread Safety".) Disabled obviously means Unsecured Stream.
It is imperative that you need the following three software components:
- for the same major version of PHP (7.0 for 7.0.xxx)
- same version of Oracle as the version you are accessing (11g, 12g, etc.)
- the same Non-Thread Safe / Thread Safe version of PHP
- all on the same architecture.
If any of the following applies to a different architecture, and not to the threaded / threaded / threaded safe version, the main PHP number, or the database version, you will get errors:
1. PHP for Windows 2. OCI8 PECL Drivers for PHP (https:
Remember: if you are connecting to an Oracle 11g instance, you need the 11g driver.
Secondly , install the correct PHP, OCI8 PECL driver and instant client.
I chose:
d:\php\ for php d:\oci\ for instant client unzip the contents of the OCI8 PECL Driver into d:\php\ext\
Third , change d: \ php \ php.ini according to Oracle instructions:
1. set the extension directory 2. set only one of the following: a. for 11g drivers, use extension=php_oci8_11g.dll b. for 12c drivers, use extension=php_oci8_12c.dll c. for other oracle DB drivers, use the correct oracle extension.
Fourth: add d: \ oci \ (or wherever you are at the time of client installation) to your PATH system variable.
Fifth : restart the computer.
Sixth , at the command prompt, enter "where oci *" and make sure that oci.dll is installed in your path to install Instant Client.
Seventh , go to d: \ php \ and type "php -m" and you should see OCI8 in the list.
If you do not see OCI8 in the list of modules after entering "php -m", open d: \ php \ errorlog.txt
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_11g.dll' - %1 is not a valid Win32 application.
then instantly loading the client or your PECL driver is different from the architecture of your version of PHP.
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_12c.dll' - The specified procedure could not be found.
then you are using the wrong OCI8 PECL driver for your client version for instant access.
Hope this helps.