本文中的操作系统:CentOS Linux release 7.7.1908 (Core)
前言:
很多情况下,搭建完按成了lnmp之后(无论是一步一步从头到尾一个一个软件进行编译安装,还是直接使用网上提供的一键安装的方式),事后你要编译安装一个php扩展的时候,发现需要用到php-config这个可执行文件,但是。。你用遍了which、whereis、find。。。等各种命令。。却发现系统中居然没有该文件!!不慌。。本文教你安装上。
1、搜索yum源中是否存在php7.0或php7.1或php7.2相关的软件包[root@ecs-abcf ~]# yum search php7
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
Warning: No matches found for: php7
No matches found
[root@iZm5e8vp7zjro140az4o97Z ~]#
尴尬。。yum源中木有啊。。
2、更换yum源# yum install epel-release
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3、再次搜索yum源中否存在php7.0或php7.1或php7.2相关的软件包[root@ecs-abcf ~]# yum search php7
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.neusoft.edu.cn
* epel: mirrors.njupt.edu.cn
* extras: ap.stykers.moe
* updates: mirrors.huaweicloud.com
* webtatic: uk.repo.webtatic.com
====================================================================================== N/S matched: php7 ======================================================================================
mod_php71w.x86_64 : PHP module for the Apache HTTP Server
mod_php72w.x86_64 : PHP module for the Apache HTTP Server
php70w.x86_64 : PHP scripting language for creating dynamic web sites
php70w-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php70w-cli.x86_64 : Command-line interface for PHP
php70w-common.x86_64 : Common files for PHP
php70w-dba.x86_64 : A database abstraction layer module for PHP applications
php70w-devel.x86_64 : Files needed for building PHP extensions
php70w-embedde