Home > Article > Backend Development > How to connect php7 to oracle
1. Open the PHP extension, php_pdo_oci.dll, php_oci8_12c.dll, and php_oci8.dll.
Then check phpinfo
Copy the path marked on the picture.
Open CMD and execute: mkdir c:\php-sdk\oracle\x64\instantclient_12_1\sdk to create the directory.
2. Unzip the prepared Instant Client, and then copy all the files in the root directory to the sdk directory created above. (Important)
3. Create environment variable
Path, add C:\php-sdk\oracle\x64\instantclient_12_1\sdk
ORACLE_HOME = C:\php-sdk\oracle\x64\instantclient_12_1\sdk
TNS_ADMIN = C:\php-sdk\oracle\x64\instantclient_12_1\sdk
4. Copy File:
1> Copy the files in the C:\php-sdk\oracle\x64\instantclient_12_1\sdk directory to Apache's bin directory
2> Similarly, copy the above files, Copy to the root directory of PHP.
Just restart the Apache service.
connect:
The above is the detailed content of How to connect php7 to oracle. For more information, please follow other related articles on the PHP Chinese website!