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

下面由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

文心一言 文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

文心一言 1008 查看详情 文心一言

下载的文件:

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]# lsoci8                                                    oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpmoracle-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.rpmrpm -Uvh oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpmrpm -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/phpizeConfiguring 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/libchecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for a sed that does not truncate output... /bin/sedchecking for pkg-config... /bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking for cc... ccchecking whether the C compiler works... yeschecking 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/modulesIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify 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]# lsgd.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.soextenstion=oci8.so

以上就是一文详解关于CentOS 7 OCI 8 的安装的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/378145.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年11月6日 10:23:00
下一篇 2025年11月6日 10:24:17

发表回复

登录后才能评论
关注微信