php 7.3.x
os : centos 7.x
먼저 리눅스에 설치할 oracle-instantclent 를 다운받아 설치를 진행한다
다운로드 주소는 https://www.oracle.com/kr/database/technologies/instant-client/linux-x86-64-downloads.html
rpm 파일 2개 다운로드 및 설치 진행
1 2 3 |
[root@xinet ~]# rpm -Uvh oracle-instantclient19.10-basic-19.10.0.0.0-1.x86_64.rpm [root@xinet ~]# rpm -Uvh oracle-instantclient19.10-devel-19.10.0.0.0-1.x86_64.rpm |
php 7.3 버전에 맞는 oci 버전을 다운로드 ( php 8버전은 oci8-3.0.x 버전 다운로드 후 진행) 후 phpize 실행 및 make 진행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@xinet ~]# wget https://pecl.php.net/get/oci8-2.2.0.tgz [root@xinet ~]# tar xvfz oci8-2.2.0.tgz [root@xinet ~]# cd oci8-2.2.0 [root@xinet oci8-2.2.0]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20180731 Zend Module Api No: 20180731 Zend Extension Api No: 320180731 [root@xinet oci8-2.2.0]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/19.10/client64/lib/ [root@xinet oci8-2.2.0]# make [root@xinet oci8-2.2.0]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/debug-zts-20180731/ |
php.ini 파일에 등록
1 2 3 4 |
[root@xinet oracle]# vi /usr/local/apache/conf/php.ini extension=oci8.so |