Build a PHP + Oracle client on Ubuntu

Source: Internet
Author: User
Let's talk about how to build a PHP + Oracle client on Ubuntu for your reference only. [Environment] NoLSBmodulesareavailable. DistributorID: UbuntuDescription: Ubuntu10.04.3LTSRelease: 10.04 Codename: & n

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.

CentOS 6.3 install LNMP (PHP 5.4, MyySQL5.6) http://www.linuxidc.com/Linux/2013-04/82069.htm

Http://www.linuxidc.com/Linux/2013-03/81120.htm of two problems with Nginx startup failure when deploying LNMP

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup) http://www.linuxidc.com/Linux/2012-10/72458.htm

Php hd scan PDF + CD source code + a full set of teaching video http://www.linuxidc.com/Linux/2014-03/97536.htm

Development Environment http://www.linuxidc.com/Linux/2013-12/93869.htm for configuring php lnmp in CentOS 6

PHP details: Click here
PHP: Click here

For more information about Oracle, see Oracle topics page http://www.linuxidc.com/topicnews.aspx? Tid = 12

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-02/114257.htm

Related Article

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.