PHP is recommended to operate Oracle databases by using the OCI8 extension.
The method for enabling PHP OCI8 extension on the internet is roughly as follows:
(1) Remove the comments of extension = php_oci8.dll in php. ini (first use phpinfo to check where your php. ini is located and do not change it to the wrong one.
Make sure that the php_oci8.dll file is in the directory specified by the extension_dir parameter.
(2) Restart Webserver.
Today, I performed the preceding steps on a machine without Oracle installation, but the OCI8 extension is still unavailable.
Later, I found on the Internet that this situation may be caused by the lack of several key DLL files in Oracle. you can install the Oracle Instant Client to add these DLL files.
The Oracle Instant Client is as follows:
Http://download.oracle.com/auth/otn/nt/instantclient/112010/instantclient-basic-win32-11.2.0.1.0.zip? E = 1291455905 & h = b028eef8e7f3831a30ca778d77582963
After the download, decompress it to C: \ instantclient_11_2 (unfixed location) and add the PATH to the beginning of the system PATH environment variable.
Restart the Webserver and view the phpinfo. You can view the OCI8 module information.
To sum up, follow these steps to enable the PHP OCI8 extension:
(1) Remove the comments before extension = php_oci8.dll in php. ini.
(2) install the Oracle Instant Client and add the installation directory to the system PATH environment variable.
Note: This step is important to add environment variables.
(3) restart the Webserver and use phpinfo to check whether the OCI8 module appears.
The following is an official Oracle Installation instruction, which is detailed:
Nstalling PHP and the Oracle Instant Client for Linux and Windows
Http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html
In addition, I feel good about the PHP Oracle operations:
Http://wiki.oracle.com/page/PHP+Oracle+FAQ
A pdf Working PHP and Oracle file. The link is as follows;
Http://blogs.oracle.com/alisonHolloway/gems/ahollowaosdc2006.pdf
OCI8 PHP manual for Oracle operations:
Http://php.net/manual/en/book.oci8.php
Finally, add oci to the path environment variable.