>  기사  >  운영 및 유지보수  >  CentOS 7 OCI 8 설치를 자세히 설명하는 기사

CentOS 7 OCI 8 설치를 자세히 설명하는 기사

藏色散人
藏色散人앞으로
2021-11-19 16:09:312195검색

아래 centos 튜토리얼 칼럼에서는 CentOS 7 OCI 8 설치 방법을 소개하겠습니다. 도움이 필요한 친구들에게 도움이 되었으면 좋겠습니다!

1. Oracle 파일 다운로드: 연결된 Oracle 데이터베이스와 일치해야 합니다. 예: Oracle 11.0.2.4가 연결되어 있어야 합니다. 다운로드한 파일은 11 버전이어야 합니다. 다음은 Oracle 11.0.2.4를 사용한 예입니다.


다운로드 주소: 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

3.1의 oci 확장자를 추가합니다. 컴파일된 패키지

[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 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 learnku.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제