In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Installation and Configuration of PHP Oracle Extension OCI8 under Linux System
PHP program access oracle DB
Date: September 2, 2014
Author: qunyingliu
Environment Description: Apache version, PHP version,Oracle DB version, Linux distribution version
RPM package installation oracle-instantclient client
source code compilation install oci8 extension
System environment and php configuration modification: ld.so.conf.d directory configuration file and php.ini extension field information modification
Restart apache to take effect
Test the link code to confirm successful configuration
Environment Description:
Local System: Centos Linux 6.4 x64
apache 2.2.22:/usr/local/apache2
PHP 5.4 : /usr/local/php
oracle DB 11.2.0.4
RPM package installs local oracle client:
Download the following RPM packages from oracle Instant Client:
http://www.oracle.com/technetwork/cn/topics/linuxx86-64soft-092277.html
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
Use the following command to install:
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
Oci8 extension download:
wget http://pecl.php.net/get/oci8-1.4.10.tgz
Decompress: tar -zxvf oci8-1.4.10.tgz
Installation:
cd oci8-1.4.10/usr/local/php/bin/phpize CFLAGS="-I/usr/lib/oracle/11.2.0.4.0/client64/" CXXFLAGS="-I/usr/lib/oracle/11.2.0.4.0/client64/"
./ configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=instantclient,/usr/lib/oracle/11.2.0.4.0/client64/lib/
make
make instal
The lphp path and oracle client path need to be modified according to the actual situation.
If the pecl program exists on your system, you can install the oci8 extension by issuing the following command:
pecl install oci8
System environment and php configuration modification Modify system configuration:
echo "/usr/lib/oracle/11.2.0.4.0/client64//lib/"
>/etc/ld.so.conf.d/oracle_client.conf/sbin/ldconfig
Modify the php.ini configuration file:
extension_dir = "/usr/local/php5/lib/ext"
extension = "oci8.so"
oci8.privileged_connect = on
Restart apache to take effect
/usr/local/apache2/bin/apachectl restart
Test the link code to confirm successful configuration
Related references:
http://php.net/manual/zh/function.oci-connect.php
http://php.net/manual/zh/book.oci8.php
http://pecl.php.net/get/oci8-1.4.10.tgz
http://pecl.php.net/package-changelog.php? package=oci8
http://www.oracle.com/technetwork/cn/topics/linuxx86-64soft-092277.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.