Home  >  Article  >  Backend Development  >  How to connect php to oracle database

How to connect php to oracle database

王林
王林Original
2019-09-20 17:52:407477browse

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)

How to connect php to oracle database

2. Unzip Instant Client

How to connect php to oracle database

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

How to connect php to oracle database

How to connect php to oracle database

4. Set the ORACLE environment variable to the path where the Instant Client is located as shown below

How to connect php to oracle database

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)

How to connect php to oracle database

How to connect php to oracle database

6. Restart the apache server to make the configuration take effect. After that, php can use the program. Connect to oracle database

How to connect php 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn