目錄
3.4 make" > 3.4 make
首頁 運維 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
登入後複製
[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上管理系統服務,涵蓋啟動,停止,啟用啟動和故障排除服務。

如何使用TOP,HTOP和VMSTAT等工具來監視CentOS中的系統性能? 如何使用TOP,HTOP和VMSTAT等工具來監視CentOS中的系統性能? Mar 17, 2025 pm 04:41 PM

本文討論了使用TOP,HTOP和VMSTAT監視CentOS系統性能,詳細介紹了它們的功能,差異和自定義,以進行有效的系統分析。

如何執行最小的CentOS安裝? 如何執行最小的CentOS安裝? Mar 14, 2025 pm 03:51 PM

本文詳細介紹了最小CentOS安裝的步驟,涵蓋下載,引導媒體創建和系統設置。它討論了諸如資源使用減少和增強安全性之類的好處,並使用YUM解釋了安裝後軟件管理

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

本文討論了使用百勝和DNF在CentOS中的包裝管理,詳細說明了其命令,差異和故障排除。關鍵差異包括速度,依賴性分辨率和模塊化,而DNF為CentOS 8中的默認值。

如何使用防火牆在CentOS建立防火牆? 如何使用防火牆在CentOS建立防火牆? Mar 17, 2025 pm 04:44 PM

本文提供了有關在CentOS上設置和管理FireWalld的綜合指南,包括安裝,啟用,基本命令和故障排除步驟。

See all articles