Build a PHP + Oracle client on Ubuntu

Source: Internet
Author: User

Build a PHP + Oracle client on Ubuntu

Let's talk about how to build a PHP + Oracle client on Ubuntu for your reference only.

[Environment]
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid

[STEP]
Update
# Sudo apt-get update; sudo apt-get upgrade
Add required packages
# Sudo apt-get install php5-dev build-essential php-pear libaio1
Install unzip:
# Sudo apt-get install unzip
Download the Instant Client

Http://www.oracle.com/technology/tech/oci/instantclient/index.html according to requirements on oracle Official Website

Theory: basic-packages and sdks. For insurance: Download two packages: basic and sdk.

Official start:

Set up a directory and decompress it:
# Sudo mkdir/opt/oracle
# Sudo cp ~ /*. Zip/opt/oracle
# Cd/opt/oracle
# Sudo unzip./*. zip
# Sudo mv instantclient_11_1 instantclient

Set instantclient:
# Sudo ln-s libclntsh. so.11.1 libclntsh. so
# Sudo ln-s libocci. so.11.1 libocci. so
# Export ORACLE_HOME =/opt/oracle/instantclient

Add the lib library location:
# Cd/etc/ld. so. conf. d
# Sudo nano liboci. conf // Add a row:/opt/oracle/instantclient
# Sudo ldconfig

Prepare the OCI8 database:
# Sudo mkdir/tmp/src
# Cd/tmp/src
# Sudo pecl download oci8
# Sudo tar vzxf oci8-1.3.5.tgz // the version I downloaded is 135
# Cd oci8-1.3.5

Compile OCI8:
# Sudo phpize // error-prone location, if an error is reported, you may not have installed the php5-dev package
# Sudo./configure-with-oci8 = share, instantclient, $ ORACLE_HOME
# Sudo make; sudo make install

Set php5 support:
After compilation is completed, the following message is displayed: Installing shared extensions:/usr/lib/php5/20060613/
Check whether oci8.so exists in this directory.
# Cd/etc/php5/conf. d
# Sudo nano oci8.ini // Add a row: extension = oci8.so


[End]

Restart apache

Phpinfo ()

Oci8 is displayed.

The connection to oracle code can be verified successfully.

Install LNMP in CentOS 6.3 (PHP 5.4, MyySQL5.6)

Nginx startup failure occurs during LNMP deployment.

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

Detailed php hd scanning PDF + CD source code + full set of teaching videos

Configure the php lnmp development environment in CentOS 6

PHP details: click here
PHP: click here

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.