惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
N
Netflix TechBlog - Medium
博客园 - 聂微东
Y
Y Combinator Blog
罗磊的独立博客
博客园_首页
小众软件
小众软件
有赞技术团队
有赞技术团队
爱范儿
爱范儿
F
Fortinet All Blogs
C
Check Point Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏

秋水逸冰

丽萨主机:双ISP家宽住宅IP VPS/CN2 GIA精品网/G口大带宽 | 秋水逸冰 Linux Kernel 6.18.x 编译版 | 秋水逸冰 思考未来人与 AI 的关系 | 秋水逸冰 3X-UI 面板安装和使用教程 | 秋水逸冰 Xray-UI 面板安装和使用教程 | 秋水逸冰 WCMP (Windows + Caddy + MariaDB + PHP) Nginx for Windows | 秋水逸冰 Aria2 for Windows | 秋水逸冰 Curl for Windows | 秋水逸冰 Wget for Windows | 秋水逸冰 Windows 11 Enterprise LTSC DD 镜像 Windows Server 2025 Datacenter DD 镜像 重新编译 curl 以支持 HTTP3 | 秋水逸冰 tiny10 和 tiny11 23H2 的 Windows DD 镜像 从 Apache httpd 切换到 Caddy2 LCMP (Linux + Caddy + MariaDB + PHP) Windows 11 Pro for Workstations 22H2 DD 镜像 Shadowsocks 编译版 by Teddysun | 秋水逸冰 适用于 UEFI 启动的多个 Windows 系统 DD 镜像 Linux Kernel 5.15.x 编译版 | 秋水逸冰 制作适用于 WSL 的任意 Linux 镜像 Windows 11 Pro for Workstations 21H2 DD 镜像 Windows 10 Enterprise LTSC DD 镜像 Linux Kernel 5.14.x 编译版 | 秋水逸冰 Linux Kernel 5.13.x 编译版 | 秋水逸冰 Windows Server 2022 Datacenter DD 镜像 在 Windows 10 上安装 Rocky Linux 系统 Linux Kernel 5.12.x 编译版 | 秋水逸冰 Linux Kernel 5.11.x 编译版 | 秋水逸冰 在 Windows 10 上安装 CentOS 系统
PHP编译安装常见错误总结 | 秋水逸冰
秋水逸冰 · 2014-06-06 · via 秋水逸冰

技术 秋水逸冰 19085浏览 0评论

PHP

在 CentOS 下编译 PHP5 的时候,为了安装某一扩展(ext),新增了编译参数,会出各种错误。基本上都可以通过 yum 安装相应的库或者改变编译参数来解决问题,在此记录如下。

1、PHP 出现 segmentation fault 错误
现象:安装完成后出现的这个问题让我一顿网上狂搜,但都无济于事。在运行任何有关 PHP 的命令时都会返回 segmentation fault 的错误,比如:php -v 或 php -m 等。经过不断试错和排查 php.ini,最终发现是在安装完 Zend Guard Loader 之后出现的。
原因: Zend Guard Loader 的配置错误。
解决办法:将 extension = ZendGuardLoader.so 改为 zend_extension = ZendGuardLoader.so即可。
最后,我将所有可选安装的配置都单独放到 /usr/local/php/php.d 下了,而不是一股脑放到 php.ini 中,这样便于出问题时排查。

2、ICU 相关错误
现象:Unable to detect ICU prefix or /usr//bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works
解决办法:yum install -y icu libicu libicu-devel
关于 ICU 的编译参数:./configure –with-icu-dir=/usr

3、bzip2 相关错误
现象:checking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution
解决办法:yum install -y bzip2 bzip2-devel
关于 bzip2 的编译参数:./configure –with-bz2

4、gmp 相关错误
现象:checking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.h
解决办法:yum install -y gmp-devel
关于 gmp 的编译参数:./configure –with-gmp

5、readline 相关错误
现象:configure: error: Please reinstall libedit – I cannot find readline.h
解决办法:安装 Editline Library (libedit),官网:http://thrysoee.dk/editline/
下载最新版 libedit 编译安装即可。
关于 readline 的编译参数:./configure –with-readline

6、xsl 相关错误
现象:configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决办法:yum install -y libxslt libxslt-devel libxml2 libxml2-devel
关于 xsl 的编译参数:./configure –with-xsl

7、pcre 相关错误
现象:checking for PCRE headers location… configure: error: Could not find pcre.h in /usr
解决办法:yum install -y pcre-devel
关于 pcre 的编译参数:./configure –with-pcre-dir
备注:在 CentOS 5.x 中,pcre 的最新版本为 6.6,版本过低会导致在编译 Apache 2.4.x 的时候出现错误。因此,建议编译安装 pcre 的最新版 8.35,替换低版本的 pcre。

转载请注明:秋水逸冰 » PHP编译安装常见错误总结