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