环境: Centos7 x86_64 PHP 7.1.2(安装路径:/usr/local/php7.1.2)&n
环境: Centos7 x86_64
PHP 7.1.2(安装路径:/usr/local/php7.1.2)
oracle 11G R2
1.下载Oracle客户端:(Http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html)
instantclient-basic-linux.x64-11.2.0.4.0.zip
instantclient-sdk-linux.x64-11.2.0.4.0.zip
2.下载php oracle模块
wget http://pecl.php.net/get/oci8-2.1.4.tgz
3.安装依赖包
yum -y install autoconf automake GCc libaio-devel unzip
4.安装
cd ~
unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip
cp instantclient_11_2/libclntsh.so.11.1 instantclient_11_2/libclntsh.so
tar zxf oci8-2.1.4.tgz
cd oci8-2.1.4
/usr/local/php7.1.2/bin/phpize
./configure --with-php-config=/usr/local/php7.1.2/bin/php-config --with-oci8=instantclient,/instantclient_11_2
make && make install
echo 'extension = "oci8.so"'>>/usr/local/php7.1.2/etc/php.ini
5.测试
/usr/local/php7.1.2/bin/php -m |grep oci
oci8
<?php
$conn = oci_connect('username','passWord','192.168.1.100/ORCL');
$sql = "select * from table_name ";
$ora_test = oci_parse($conn,$sql);
oci_execute($ora_test,OCI_DEFAULT);
while($r=oci_fetch_row($ora_test))
{
echo $r[0];
echo "<BR>";
}
?>
--结束END--
本文标题: PHP提供Oracle支持增加oci8模块
本文链接: https://lsjlt.com/news/38657.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0