1.
yum install php.x86_64 ()
yum php-mysql.x86_64 (不確定)
yum install php-pear
yum install php-devel
2.
pear download pecl/oci8
tar vzf oci8-x.x.x.tar
cd oci8-x.x.x/
phpize
(確認整個OS只有一個php/phpize/
ph-config/pecl/pear/peardev
/的版本,我在這裡吃了大苦頭。由於有兩個版本,compile一直用到舊版本。
如果有舊版本,通常會在/usr/loca/bin裡面,可以用find / -name php...找。
但是使用yum install php... 安裝的通常在/usr/bin,而$PATH的/usr/local/bin通常又先於/usr/bin,所以一直抓到舊版)
3.
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/xxx/client64/lib/ (xxx是Oracle 版本)4.
make
make install
5.
setsebool -P httpd_execmem 1 (如果有啟動SEinux)
6.
vi /etc/php.ini
or
make install
5.
setsebool -P httpd_execmem 1 (如果有啟動SEinux)
6.
vi /etc/php.ini
[OCI8]
extension=oci8.so
extension=oci8.so
cd /etc/php.d
vim oci8.ini
extension=oci8.so
vim oci8.ini
extension=oci8.so
以下為原文
HOWTO install Oracle OCI8 on RHEL / CentOS / Fedora
How to install OCI8 (PHP extension to access Oracle Databases) on a RHEL / Fedora Linux system.
Download from http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html :
EDIT 2013/09/24 : http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Install some prerequisite
Download the OCI8 extension
Configure the extension with your Oracle client library path (change the path …/11.2/… with your own version) :
Compil and install
Configure SELinux : allows httpd to execute programs that require memory addresses that are both executable and writeable
Add the folowing configuration at the end of php.ini
Restart Apache
That’s all folks.
Download from http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html :
EDIT 2013/09/24 : http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
- RPM Instant Client Package – SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
- RPM Instant Client Package – Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
rpm -ivh instantclient-basic-linux.XXX.rpm
rpm -ivh instantclient-sdk-linux.XXX.rpm
rpm -ivh instantclient-sdk-linux.XXX.rpm
yum install php-pear
yum install php-devel
yum install php-devel
pear download pecl/oci8
tar xvzf oci8-1.4.7.tgz
cd oci8-1.4.7/
phpize
tar xvzf oci8-1.4.7.tgz
cd oci8-1.4.7/
phpize
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/
make
make install
make install
setsebool -P httpd_execmem 1
vi /etc/php.ini
[OCI8]
extension=oci8.so
extension=oci8.so
service httpd restart
沒有留言:
張貼留言