Home >Backend Development >PHP7 >Does php7 not have php oci8?

Does php7 not have php oci8?

藏色散人
藏色散人Original
2022-11-14 09:26:401959browse

php7 does not have oci8 and needs to be installed and configured. The method for installing oci8 extension in php7 is: 1. Download and install "oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm"; 2 , add environment variables; 3. Search for oci8 directly on the PHP official website; 4. Install oci8 through the "pecl install oci8" command.

Does php7 not have php oci8?

The operating environment of this tutorial: centos7 system, PHP7 version, Dell G3 computer.

php7 does not have php oci8?

Requires installation and configuration.

php7 Install extension-oci8 Steps and methods:

1. Basic environment

Environment: centos7 PHP 7.2.24

2 . oracle client

2.1 Official address

https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

uses the latest version - Version 19.5.0.0.0, both must be installed, the devel version is SDK

oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm 
oracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm

2.2 Installation

rpm -ivh oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm 
rpm -ivh oracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm

After the installation is completed, the default path is –/usr/lib/oracle/19.5/client64. I have not added environment variables. If necessary, add them according to your own configuration.

vim /etc/profile
source /etc/profile

3. oci8 extension

The installation of online articles is quite confusing. Go to the PHP official website and directly search for oci8 and the results will appear;

Does php7 not have php oci8?

3.1 Installation

The first method I took was pecl install oci8; the installation process will always show Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you 're compiling with Oracle Instant Client [autodetect]: Just enter the client path address according to the official instructions: instantclient,/usr/lib/oracle/19.5/client64/lib

Does php7 not have php oci8?

3.2 Check

After the installation is completed, use –php -m to check whether the installation is successful. Enter the directory –/usr/lib64/php/modules and check whether –oci8.so exists;

Restart If it fails later, you can add extension-extension=oci8.so in the /etc/php.ini file.

3.3 Restart php-fpm

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Does php7 not have php oci8?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn