编译php常见错误集合
Apr 1, 2018
编译php7的扩展插件, 依赖的东西还蛮多的, 编译起来总是不那么丝滑顺畅, 今天把常见的问题整理下。
环境:
- 系统 centos7
 - php7.2
 
openSSL 扩展
编译添加openSSL扩展
1  | yum install openssl openssl-devel  | 
bz2 扩展
编译打开了bz2扩展会碰到
1  | checking for BZip2 support… yes  | 
解决方案
1  | yun install bzip2 bzip2-devel  | 
curl 扩展
编译打开了curl扩展会碰上个
1  | checking for cURL support… yes  | 
解决方案
1  | yun install curl curl-devel  | 
gd 扩展
编译开启了gd扩展会碰上
1  | checking for fabsf… yes  | 
解决方案
1  | yum install libpng libpng-devel  | 
freetype 字体扩展
系统没有 freetype 库
1  | checking for png_write_image in -lpng… yes  | 
解决方案
1  | $ wget https://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2  | 
libxml 扩展
系统缺少 libxml 库支持
1  | configure: error: xml2-config not found. Please check your libxml2 installation.  | 
解决方案
1  | yum install libxml libxml-devel  | 
pcre 类库
系统缺少 pcre 库支持
1  | checking for PCRE headers location… configure: error: Could not find pcre.h in /usr  | 
解决方案
1  | yum install pcre pcre-devel  | 
t1lib支持
系统缺少t1lib支持
1  | configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.  | 
解决
1  | yum install t1lib-devel.x86_64  | 
mcrypt 加解密类库
系统缺少 mcrypt 库
1  | configure: error: mcrypt.h not found. Please reinstall libmcrypt.  | 
解决
1  | yum install libmcrypt libmcrypt-devel  | 
mysql 相关的错误
出现mysql相关的错误总结一点
- mysql-devel 包需要安装, 基本不会有问题。