Home >Backend Development >PHP Problem >How to connect php to oracle database
PHP connects to the oracle database
1. First download the "Instant Client" (oracle client), select download as shown in the example below 32-bit green version client (the number of client bits needs to be the same as the number of bits of the PHP interpreter)
2. Unzip Instant Client
3. Configure the tnsnames.ora file. The HOST parameter is the database address, PORT is the database port number, and SERVICE_NAME is the database example name
4. Set the ORACLE environment variable to the path where the Instant Client is located as shown below
5. Place the php_oci8.dll file under the "php\ext" path, modify the php.ini configuration file and add the extension=php_oci8.dll extension, and enable the extension_dir extension directory (this Take xampp as an example)
6. Restart the apache server to make the configuration take effect. After that, php can use the program. Connect to oracle database
Recommended tutorial: PHP video tutorial
The above is the detailed content of How to connect php to oracle database. For more information, please follow other related articles on the PHP Chinese website!