首页 运维 CentOS 一文详解关于CentOS 7 OCI 8 的安装

一文详解关于CentOS 7 OCI 8 的安装

Nov 19, 2021 pm 04:09 PM

下面由centos教程栏目给大家介绍关于CentOS 7 OCI 8 的安装方法,希望对需要的朋友有所帮助!

centos7 oci8安装

1.下载oracle文件:必须和连接的oracle数据库一致,如:连接的是11.0.2.4的oracle,下载的文件就需要是11版本的。
以下的用11.0.2.4的oracle举例操作:

下载地址:https://www.oracle.com/cn/database/technologies/instant-client/linux-x86-64-downloads.html

下载的文件:

1.oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm2.oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm3.oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm
登录后复制

2.安装oracle-instantclien

2.1进入到/usr/local/src/目录,把下载好的rpm全部拷贝到该目录下

[root@localhost src]# pwd/usr/local/src[root@localhost src]# ls
oci8                                                    oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm
oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm  oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm
登录后复制

2.2安装包

rpm -Uvh oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm
rpm -Uvh oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm
rpm -Uvh oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm
登录后复制

2.3确认安装完成

[root@localhost oracle]# ls11.1[root@localhost oracle]# 
[root@localhost oracle]# 
[root@localhost oracle]# pwd/usr/lib/oracle[root@localhost oracle]#
登录后复制

3.添加php的oci扩展

3.1.进入编译包

[root@localhost oci8]# pwd/var/www/html/php-7.4.0/ext/oci8[root@localhost oci8]#
登录后复制

3.2./usr/local/php740/bin/phpize

[root@localhost oci8]# /usr/local/php740/bin/phpize
Configuring for:PHP Api Version:         20190902Zend Module Api No:      20190902Zend Extension Api No:   320190902[root@localhost oci8]#
登录后复制

3.3 ./configure

[root@localhost oci8]# ./configure --with-php-config=/usr/local/php740/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/11.1/client64/lib
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -Echecking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
登录后复制

3.4 make

[root@localhost oci8]# make && make installPATH="$PATH:/sbin" ldconfig -n /var/www/html/php-7.4.0/ext/oci8/modules----------------------------------------------------------------------Libraries have been installed in:
 /var/www/html/php-7.4.0/ext/oci8/modules
If you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
 - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Build complete.Don't forget to run 'make test'.Installing shared extensions:     /usr/local/php740/lib/php/extensions/no-debug-non-zts-20190902/[root@localhost oci8]# 

[root@localhost oci8]# cd /usr/local/php740/lib/php/extensions/no-debug-non-zts-20190902/[root@localhost no-debug-non-zts-20190902]# ls
gd.so  libzip.so  mongodb.so  oci8.so  opcache.a  opcache.so  redis.so  swoole.so  xdebug.so  zip.so
登录后复制

4.1 引入

vim /usr/local/php740/lib/php.ini
下面每种都可
extension=/usr/local/php740/lib/php/extensions/no-debug-non-zts-20190902/oci8.so
extenstion=oci8.so
登录后复制

以上是一文详解关于CentOS 7 OCI 8 的安装的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

如何在CentOS中配置日志旋转? 如何在CentOS中配置日志旋转? Mar 17, 2025 pm 04:43 PM

本文介绍了如何使用Logrotate在CentOS中配置日志旋转,详细安装,配置以及磁盘空间管理和安全性等好处。

如何在CentOS上安装和配置MySQL/MariadB? 如何在CentOS上安装和配置MySQL/MariadB? Mar 17, 2025 pm 04:35 PM

文章讨论了MySQL/MariadB在CentOS上的安装,配置和故障排除,包括系统要求和安全措施。(159个字符)

如何在CentOS中使用逻辑卷管理(LVM)来管理存储? 如何在CentOS中使用逻辑卷管理(LVM)来管理存储? Mar 17, 2025 pm 04:51 PM

本文讨论了使用CentOS中的逻辑音量管理(LVM)进行有效的存储管理,详细介绍了设置,扩展和备份/还原过程的步骤,并突出了LVM比传统分区的优势。

如何使用CentOS中的SystemD管理系统服务? 如何使用CentOS中的SystemD管理系统服务? Mar 17, 2025 pm 04:38 PM

本文介绍了如何使用SystemD在CentOS上管理系统服务,涵盖启动,停止,启用启动和故障排除服务。

如何使用CentOS和PHP-FPM构建高频率应用程序? 如何使用CentOS和PHP-FPM构建高频率应用程序? Mar 12, 2025 pm 06:19 PM

本文详细介绍了CentOS上建立高电流PHP-FPM应用程序。 它解决了关键问题,例如服务器配置(硬件,PHP-FPM设置,负载平衡),缓存,数据库优化,代码效率和资源监视。

如何使用TOP,HTOP和VMSTAT等工具来监视CentOS中的系统性能? 如何使用TOP,HTOP和VMSTAT等工具来监视CentOS中的系统性能? Mar 17, 2025 pm 04:41 PM

本文讨论了使用TOP,HTOP和VMSTAT监视CentOS系统性能,详细介绍了它们的功能,差异和自定义,以进行有效的系统分析。

处理CentOS上备份和灾难恢复的最佳方法是什么? 处理CentOS上备份和灾难恢复的最佳方法是什么? Mar 12, 2025 pm 06:21 PM

本文详细介绍了CENTOS备份和灾难恢复(DR)最佳实践。 它强调了一种多面方法,包括常规备份(完整,增量,差异),异地存储和严格的测试。 高可用性聚类

如何使用百胜或DNF在CentOS中管理软件包? 如何使用百胜或DNF在CentOS中管理软件包? Mar 17, 2025 pm 04:39 PM

本文讨论了使用百胜和DNF在CentOS中的包装管理,详细说明了其命令,差异和故障排除。关键差异包括速度,依赖性分辨率和模块化,而DNF为CentOS 8中的默认值。

See all articles