PHP 扩展,每次编译安装挺麻烦,而用yum装就很简单
前提:PHP必须是yum安装的
如果是编译安装的PHP,那么扩展你也只有编译安装了
第一步 搜索
yum search php72-php-gd
注意名字要根据你安装的PHP版本来搜索
或者直接搜索全部
比如:你安装的php72版本
yum search php72
已加载插件:fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* remi-safe: ap.stykers.moe
* updates: mirrors.aliyun.com
============================================================================================================================== N/S matched: php72 ==============================================================================================================================
php72-php-fpm.x86_64 : PHP FastCGI Process Manager
php72-php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php72-php-geos.x86_64 : PHP module for GEOS
在结果里面找到你要安装的扩展
第二步 安装
yum install -y php72-php-gd