Home  >  Article  >  Backend Development  >  How to install php7 extension in yum

How to install php7 extension in yum

藏色散人
藏色散人Original
2021-12-16 10:04:372909browse

Yum method to install php7 extension: 1. Install epel and REMI sources; 2. Check the PHP version that can be installed and use the "yum -y install php" command to install PHP; 3. Use "yum -y install Just run the php-fpm" command to install the PHP extension.

How to install php7 extension in yum

The operating environment of this article: centos7 system, PHP version 7.4, Dell G3 computer.

yum How to install php7 extension?

Centos7 yum installation PHP7 and PHP extension installation:

1. Install epel:

#yum list installed | grep php
#查看已安装的PHP,查到后rpm -e 卸载
#yum repolist all | grep php
yum install epel-release -y

2. Install REMI source:

rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm

3. Check the PHP version that can be installed:

yum repolist all | grep php

4. Set the default installed version:

yum

5. Install PHP:

yum -y install php
#查看PHP版本
php -v
#查看已安装的模块
php -m

6. Check which PHP extensions can be installed:

yum search php74-php

7. Install PHP extension:

示例:安装php74-php-fpm扩展,则执行:(不用加php74-)
yum -y install php-fpm

8.php-fpm command:

# 启动
systemctl start php-fpm

# 停止
systemctl stop php-fpm

#重启
systemctl restart php-fmp

# 重载
systemctl reload php-fpm 

#设置开机启动
systemctl enable php-fpm 

#禁止开机启动
systemctl disable php-pfm

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to install php7 extension in yum. 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