一、缘由
今天打开宝塔面板,发现php8.1提示升级,升级之后提示无法启动,就删除PHP重新安装PHP,我从php5.3安装到php8.2都提示“Package 'freetype2', required by 'virtual:world', not found”,显示情况如下。
checking for libwebp… yes
checking for libjpeg… yes
checking for freetype2… no
configure: error: Package requirements (freetype2) were not met:
Package 'freetype2', required by 'virtual:world', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FREETYPE2_CFLAGS
二、查找原因
根据网络上的提示,一般认为缺少libfreetype-dev、libfreetype6-dev,可是安装还是不行。本机系统centOS
输入命令:sudo yum install libfreetype-dev libfreetype6-dev
系统提示:
Last metadata expiration check: 0:08:16 ago on Mon 07 Aug 2023 09:51:00 PM CST.
No match for argument: libfreetype-dev
No match for argument: libfreetype6-dev
最终查找到一篇文献,缺乏freetype-devel
三、问题解决
在终端中输入:sudo yum install freetype-devel
显示安装完毕,顺利安装php相关版本。