註:本文適用於RHEL/CentOS發行版。
步驟1.安裝構建自定義PHP 7模組所需的devel包
# yum install plesk-php70-devel gcc glibc-devel libmemcached-devel zlib-devel make libaio.x86_64
步驟2.下載oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm和oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm(來自Oracle OTN),並將其上傳到伺服器上。
步驟3.安裝oracle-instantclient12 *包:
# rpm -Uhv oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
步驟4.用pecl安裝oci8包
# /opt/plesk/php/7.0/bin/pecl install oci8
步驟5.在php.ini中啟用oci8模組
# echo "extension=oci8.so" > /opt/plesk/php/7.0/etc/php.d/oci.ini
要為通過Plesk安裝的其他PHP引擎安裝oci8擴充套件,請為相應的PHP版本安裝PHP devel包。
例如,對於PHP 7.2:
# yum install plesk-php72-devel
重複上面的步驟4,5,確保路徑是當前PHP版本的:
# /opt/plesk/php/7.2/bin/pecl install oci8
# echo "extension=oci8.so" > /opt/plesk/php/7.2/etc/php.d/oci.ini
檢查擴充套件是否已啟用:
# /opt/plesk/php/7.2/bin/php -m | grep oci oci8
相關推薦:《PHP教學》
以上就是如何為Plesk PHP 7啟用Oracle OCI8擴充套件?的詳細內容,更多請關注TW511.COM其它相關文章!