当前位置:首页 > 服务器运维 > 正文内容

debian安装orcale支持库

Z先生11个月前 (12-16)服务器运维712

官方说明

https://pecl.php.net/package/oci8

安装基础环境

apt-get install libaio1
apt-get install alien

安装21版本库

其他版本详见:https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html 版本兼容性详见(需要登录):https://support.oracle.com/epmos/faces/DocumentDisplay?id=207303.1

下载

wget https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-basic-21.16.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-sqlplus-21.16.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-devel-21.16.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-jdbc-21.16.0.0.0-1.x86_64.rpm
wget  https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-odbc-21.16.0.0.0-1.x86_64.rpm

安装

alien -i oracle-instantclient-basic-21.16.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient-sqlplus-21.16.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient-devel-21.16.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient-jdbc-21.16.0.0.0-1.x86_64.rpm
alien -i oracle-instantclient-odbc-21.16.0.0.0-1.x86_64.rpm

环境配置

在文件/etc/ld.so.conf最后加入

nano /etc/ld.so.conf

在文件最后加入

/usr/lib/oracle/21/client64/lib

然后执行ldconfig使配置生效。 执行sqlplus来验证配置。

/etc/profile文件最后,加入

nano /etc/profile

在文件最后加入

export ORACLE_HOME=/usr/lib/oracle/21/client64
export ORACLE_BASE=/usr/lib/oracle/21
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

保存退出后执行以下命令后使环境变量生效:

source /etc/profile

建立软连接

ln -s /usr/lib/oracle/21/client64 /usr/lib/oracle/21/client
ln -s /usr/include/oracle/21/client64 /usr/include/oracle/21/client

PHP安装扩展

推荐使用pecl安装,详见:http://pear.php.net

pecl install oci8 pdo_oci

中途需要输入路径:instantclient,/usr/lib/oracle/21/client64/lib

修改php.ini文件,加入扩展。如果不知道php.ini在什么地方,可执行:php --ini查看配置文件路径

extension=oci8.so
extension=pdo_oci.so

可以通过

php -m | grep oci

验证是否成功


分享给朋友:
返回列表

上一篇:debian安装mssql支持库

没有最新的文章了...

相关文章

一些低危提示漏洞的处理

无关痛痒的一些漏洞HTTP X-XSS-Protection 响应头缺失HTTP X-Download-Options 响应头缺失HTTP X-Content-Type-Options 响应头缺失HT...

网站压力测试之ab命令

一、什么是ab?ab是apachebench命令的缩写。ab的原理:ab命令会创建多个并发访问线程,模拟多个访问者同时对某一URL地址进行访问。它的测试目标是基于URL的,因此,它既可以用来测试apa...

Ceontos挂载Windows共享当本地硬盘使用

1、自动挂载 //192.168.128.1/wwwroot /wwwroot cifs defaults,username=user,password=000000 0 02、临时挂载...

【原创】Windows10+WSL配置本地PHP测试环境

为什么?我为什么要这样做为什么不直接在win环境下搭建呢?个人原因有一下两点 php的某些功能只有在linux下才能更好的体现,比如Workerman下的GatewayWorker 我自己办公...

安装配置code-server使用https

安装配置code-server使用https

安装软件地址:https://github.com/coder/code-server/releases 用wget下载压缩文件后用tar -xzvf解压文件。 启动命令行带参数进入解压文件夹,启...

windows server 2022开机自动登录、自启动、修改3389端口

windows server 2022开机自动登录、自启动、修改3389端口

一、自动登录打开注册表:Win+R,输入:regedit依次打开:【计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersio...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。
请先 登录 再评论,若不是会员请先 注册