Ubunt22 php8.1 oracl 连接配置

永远的零 2023-01-10 AM 888℃ 0条

输入: sudo unzip instantclient-basic-linux.x64-12.1.0.2.0.zip 输入: sudo
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip 输入: sudo mv
instantclient_12_1/ /opt/oracle/ 输入: cd
/opt/oracle/instantclient_12_1/

建立符号链接 输入: sudo ln -s libclntsh.so.12.1 libclntsh.so 输入: sudo ln -s libocci.so.12.1 libocci.so

打开 /etc/profile 在最后面加入 输入: export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1:$LD_LIBRARY_PATH 输入:

export PATH=/opt/oracle/instantclient_12_1:$PATH

最后source一下,使配置生效 输入: source /etc/profile

export ORACLE_HOME=/opt/oracle/instantclient_11_2

添加lib库位置:

cd /etc/ld.so.conf.d

sudo nano liboci.conf //添加一行:/opt/oracle/instantclient

sudo ldconfig

增加 PATH 环境变量: export PATH=/usr/lib/oracle/21/client64/bin:$PATH export
PATH=/opt/oracle/instantclient_11_2:$PATH 编译安装 oci8 从第 6 链接下载 oci8
源码包,并进行编译安装: tar xvf oci8-3.0.1.tgz phpize ./configure
--with-oci8=shared,instantclient,/opt/oracle/instantclient_11_2 --with-php-config=/www/server/php/81/bin/php-config make && make install

php.ini 文字中添加:extension = oci8

检查是否安装成功: php -m |grep oci8

https://cloud.tencent.com/developer/article/2039832
http://t.zoukankan.com/imzhi-p-15561448.html

2023-01-09T18:03:13.png
2023-01-09T18:02:43.png

人要么永不做梦,要么梦得有趣;人也必须学会清醒:要么永不清醒,要么清醒得有趣。

评论啦~