http://www.syahzul.com/2016/04/06/how-t ... d-php-5-6/
If your PHP application is using Oracle DBMS, you will need to install OCI8 PECL extension. Sometimes it’s quite tricky to make it work. Let’s make our hand dirty.
Requirements
Make sure met the following requirements:
Free account on Oracle website to download Oracle Instant Client and SDK files,
Full sudo access to your server,
PHP 5.6 and web server installed (tested with nginx and PHP-FPM).
Install Oracle Instant Client and SDK
STEP 1
Download the Oracle Instant Client and SDK from Oracle website. Make sure you choose the correct architecture for your Ubuntu installation (32bit is x86, 64bit is x86_64). You’ll need to upload the files to your server using whatever method suits you.
STEP 2
Create a new folder to store Oracle Instant Client zip files on your server.
mkdir /opt/oracle
Upload the Instant Clients files inside this folder.
STEP 3
Now we need to extract the files.
cd /opt/oracle
unzip instantclient-basic-linux-12.1.0.2.0.zip
unzip instantclient-sdk-linux-12.1.0.2.0.zip
STEP 4
Next, we need to create a symlink to Instant Client files.
ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so
ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so
STEP 5
Add the folder to our ldconfig.
echo /opt/oracle/instantclient_12_1 > /etc/ld.so.conf.d/oracle-instantclient
STEP 6
Update the Dynamic Linker Run-Time Bindings
ldconfig
Done. Now we can proceed to the next part.
Install Additional Packages
To install the OCI8 extension, we need to install some additional package on our server.
STEP 1
Run these command:
apt-get install php-pear php5-dev build-essential libaio1
STEP 2
Once installed, we need to get the OCI8 file.
pecl install oci8-2.0.10
When you are prompted for the Instant Client location, enter the following:
instantclient,/opt/oracle/instantclient_12_1
STEP 3
We need to tell PHP to load the OCI8 extension.
echo "extension = oci8.so" >> /etc/php5/fpm/php.ini
echo "extension = oci8.so" >> /etc/php5/cli/php.ini
STEP 4
Restart your PHP and nginx.
service php5-fpm restart
service nginx restart
Now you can connect to Oracle DBMS from your PHP applications.
Ubuntu 14.04 php 5.6 oci 8
前往
- Software
- ↳ CodeCharge Studio
- ↳ CodeCharge
- ↳ DemoCharge
- ↳ SuperPDF
- ↳ 551einv
- ↳ E3進銷存
- 程式語言
- ↳ PHP
- ↳ CodeLobster PHP Edition
- ↳ Yii
- ↳ CodeIgniter
- ↳ Phalcon
- ↳ Symfony
- ↳ FuelPHP
- ↳ Zend Framework 2
- ↳ laravel
- ↳ WordPress
- ↳ ASP.NET/C#
- ↳ ASP/VBScript
- ↳ JSP
- ↳ Java Servlets
- ↳ ColdFusion
- ↳ Perl
- ↳ Java Script
- ↳ jQuery
- ↳ HTML + CSS
- ↳ jQuery
- ↳ nodejs
- ↳ VB6
- ↳ Git
- ↳ App Inventor 2
- ↳ bash
- ↳ C++/ VC/ OpenCV
- ↳ OpenCV
- ↳ go
- ↳ cordova
- ↳ python
- ↳ Xamarin
- ↳ Assembly
- 資料庫
- ↳ MySQL
- ↳ PostgreSQL
- ↳ ORACLE
- ↳ Access
- ↳ SQL Server
- ↳ SQLite
- ↳ MariaDB
- ↳ Mongodb
- 作業系統
- ↳ Linux
- ↳ Ubuntu
- ↳ CentOS
- ↳ Mint
- ↳ Mandriva
- ↳ Debian
- ↳ Red Hat Enterprise Linux
- ↳ Oracle Linux
- ↳ Fedora
- ↳ Kali Linux
- ↳ OpenSUSE
- ↳ Elementary OS
- ↳ Microsoft
- ↳ Server 2008 R2
- ↳ Server 2012 R2
- ↳ Server 2012
- ↳ 8
- ↳ 10
- ↳ System Center 2016
- ↳ NOVELL
- ↳ FreeBSD
- ↳ VMware
- ↳ VirtualBox
- ↳ Mac OS X
- ↳ Solaris
- ↳ iOS
- ↳ Android
- ↳ Cloud
- ↳ OpenStack
- ↳ Docker
- ↳ Proxmox VE
- ↳ CloudReady
- ↳ chrome
- 網頁伺服器
- ↳ apache
- ↳ tomcat
- ↳ nginx
- ↳ IIS
- ↳ JBoss
- ↳ weblogic
- ↳ WebHosting
- 硬體
- ↳ 硬體及週邊
- ↳ RouterOS
- ↳ LEGO NXT
- ↳ Arduino
- ↳ MSP430
- ↳ Raspberry Pi
- ↳ OpenERP
- ↳ Storage
- ↳ Server
- ↳ Brocade
- ↳ MODELS
- ↳ FortiGate
- 軟體
- ↳ sublime
- ↳ LibreNMS