PHP installation oci8 extension under Linux

Source: Internet
Author: User

PHP is usually used with MySQL, but sometimes it is connected to an Oracle database.
Before installing PHP oci8, you need to install the Oracle Instant Client (Basic or Basic Lite) before you can expand. Since we are installing PHP extensions from the source, we also need to download the Instant Client SDK. For downloads of Oracle Instant client related packages, please go to the following link: http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html
Download the package from the link above: Instantclient-basic-linux.x64-12.1.0.1.0.zip and Instantclient-sdk-linux.x64-12.1.0.1.0.zip
The installation steps of the above two packages:
1), switch to root account
2), unzip the instantclient-basic-linux.x64-12.1.0.1.0.zip to the/usr/local/directory, the resulting path is/usr/local/instantclient_12_1/
3), unzip the Instantclient-sdk-linux.x64-12.1.0.1.0.zip, get a directory of the same name as in step 2), under which a subdirectory named SDK is moved to the/usr/local/ instantclient_12_1/directory, the final directory structure is as follows (note: libclntsh.so This symbolic link is generated in the following steps):

Cd/usr/local/instantclient_12_1

Ln-s libclntsh.so.12.1 libclntsh.so

Into the PHP source there is a ext/oci8/this directory inside

Then execute the phpize command, and then execute the./configure--with-oci8=shared,instantclient,/usr/local/instantclient_12_1--with-php-config=/ Usr/local/php/bin/php-config


After executing the./configure xxx Successful, then execute the Make command, you can compile the oci8 extension.

Then enter your php.ini to add

Extension=oci8.so

Don't forget to restart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.