当前位置: 首页 > 编程文章 >

PHP编译安装常见configure错误及解决方案

PHP编译安装常见configure错误及解决方案

作者:陈安时间:2026-10-07 11:17:49浏览:700

在Linux环境下编译安装PHP时,常因缺少特定开发库而中断。本文汇总了configure阶段常见的错误提示及其对应的修复命令。例如遇到xslt-config未找到需安装libxslt-devel,net-snmp-config缺失需安装net-snmp-devel,以及readline.h找不到需安装readline-devel等。对于部分不在默认仓库的库如libmcrypt,需手动下载编译安装。此外还涵盖了ICU、Freetype、PNG、LDAP、PostgreSQL等扩展所需的依赖包安装方法,确保编译顺利进行。

本文目录展开

PHP编译安装常见configure错误及解决方案

原文链接:https://coderwall.com/p/ggmpfa

错误信息:configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决方法: 复制代码 代码如下: yum -y install libxslt-devel 错误信息:configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation. 解决方法: 复制代码 代码如下: yum -y install net-snmp-devel 错误信息:configure: error: Please reinstall readline - I cannot find readline.h 解决方法: 复制代码 代码如下: yum -y install readline-devel 错误信息:configure: error: Cannot find pspell 解决方法: 复制代码 代码如下: yum -y install aspell-devel 错误信息:checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found! 解决方法: 复制代码 代码如下: yum -y install unixODBC-devel 错误信息:configure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works. 解决方法: 复制代码 代码如下: yum -y install libicu-devel 错误信息:configure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information. 解决方法: 复制代码 代码如下: yum -y install libc-client-devel 错误信息:configure: error: freetype.h not found. 解决方法: 复制代码 代码如下: yum -y install freetype-devel 错误信息:configure: error: xpm.h not found. 解决方法: 复制代码 代码如下: yum -y install libXpm-devel 错误信息:configure: error: png.h not found. 解决方法: 复制代码 代码如下: yum -y install libpng-devel 错误信息:configure: error: vpx_codec.h not found. 解决方法: 复制代码 代码如下: yum -y install libvpx-devel 错误信息:configure: error: Cannot find enchant 解决方法: 复制代码 代码如下: yum -y install enchant-devel 错误信息:configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/ 解决方法: 复制代码 代码如下: yum -y install libcurl-devel LAOGAO added 20140907:

错误信息:configure: error: mcrypt.h not found. Please reinstall libmcrypt. 解决方法(需手动编译): 复制代码 代码如下: wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz tar zxf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7 ./configure make && make install added 20141003:

错误信息:Cannot find imap 解决方法: 复制代码 代码如下: ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so 错误信息:configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. 解决方法: 复制代码 代码如下: yum -y install libc-client-devel 错误信息:Cannot find ldap.h 解决方法: 复制代码 代码如下: yum -y install openldap yum -y install openldap-devel 错误信息:configure: error: Cannot find ldap libraries in /usr/lib 解决方法: 复制代码 代码如下: cp -frp /usr/lib64/libldap* /usr/lib/ 错误信息:configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path 解决方法: 复制代码 代码如下: yum -y install postgresql-devel 错误信息:configure: error: Please reinstall the lib curl distribution 解决方法: 复制代码 代码如下: yum -y install curl-devel 错误信息:configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation. 解决方法: 复制代码 代码如下: yum -y install net-snmp-devel 错误信息:configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决方法: 复制代码 代码如下: yum -y install libxslt-devel 错误信息:checking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution

Fix: 复制代码 代码如下: yum -y install bzip2-devel 错误信息:checking for cURL support… yes checking if we should use cURL for url streams… no checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution – easy.h should be in/include/curl/

Fix: 复制代码 代码如下: yum -y install curl-devel 错误信息:checking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).

Fix: 复制代码 代码如下: yum -y install db4-devel 错误信息:checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.

Fix: 复制代码 代码如下: yum -y install libjpeg-devel 错误信息:checking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found.

Fix: 复制代码 代码如下: yum -y install libpng-devel 错误信息:checking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=

错误信息:configure: error: freetype.h not found. Fix: 复制代码 代码如下: Reconfigure your PHP with the following option. --with-xpm-dir=/usr 错误信息:checking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.

Fix: 复制代码 代码如下: yum -y install libXpm-devel 错误信息:checking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.h

Fix: 复制代码 代码如下: yum -y install gmp-devel 错误信息:checking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

Fix: 复制代码 代码如下: yum -y install libc-client-devel 错误信息:checking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.h

Fix: 复制代码 代码如下: yum -y install openldap-devel 错误信息:checking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!

Fix: 复制代码 代码如下: yum -y install unixODBC-devel 错误信息:checking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

Fix: 复制代码 代码如下: yum -y install postgresql-devel 错误信息:checking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distribution

Fix: 复制代码 代码如下: yum -y install sqlite-devel 错误信息:checking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspell

Fix: 复制代码 代码如下: yum -y install aspell-devel 错误信息:checking whether to enable UCD SNMP hack… yes checking for default_store.h… no

错误信息:checking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.

Fix: 复制代码 代码如下: yum -y install net-snmp-devel 错误信息:checking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

Fix: 复制代码 代码如下: yum -y install libxslt-devel 错误信息:configure: error: xml2-config not found. Please check your libxml2 installation.

Fix: 复制代码 代码如下: yum -y install libxml2-devel 错误信息:checking for PCRE headers location… configure: error: Could not find pcre.h in /usr

Fix: 复制代码 代码如下: yum -y install pcre-devel 错误信息:configure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!

Fix: 复制代码 代码如下: yum -y install mysql-devel 错误信息:checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!

Fix: 复制代码 代码如下: yum -y install unixODBC-devel 错误信息:checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

Fix: 复制代码 代码如下: yum -y install postgresql-devel 错误信息:configure: error: Cannot find pspell

Fix: 复制代码 代码如下: yum -y install pspell-devel 错误信息:configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.

Fix: 复制代码 代码如下: yum -y install net-snmp-devel 错误信息:configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

Fix: 复制代码 代码如下: yum -y install libxslt-devel

上一篇
ThinkPHP视图模型查询报错Table 'db.pr_order_view' doesn't exist的解决方法

在使用ThinkPHP框架进行多表关联查询时,若视图模型类文件命名不规范,例如将OrderViewModel.class.php误写为OrderView.class.php,系统在执行SQL时会尝试查找名为'db.pr_order_view'的物理表,从而触发ERR: 1146: Table doesn't exist错误。该问题并非数据库缺失,而是类名与预期生成的虚拟表名不匹配所致。修正类文件名为标准的ViewModel后缀即可恢复正常。

下一篇
Win7 64位系统配置PHP连接Oracle InstantClient教程

本文介绍在Win7 64位环境下,通过安装Oracle InstantClient并配置PHP OCI扩展以连接远程Oracle数据库的具体步骤。主要涵盖客户端下载解压、环境变量设置、php.ini配置及Apache服务重启测试流程。

相关文章

更多
PHP编译参数详解与最佳实践指南

本文详细解析了PHP源码编译过程中常用的configure参数,涵盖Apache整合、数据库连接、图形处理及CGI/FPM模式等核心配置。同时指出PDO优于mysqli的性能优势,强调在产品环境中关闭magic-quotes等不安全选项,并根据服务器负载选择合适的OPCode缓存方案以实现最佳性能。

2025.12.19 958
编译安装PHP 5.2.14配合FPM与Memcached扩展详解

本文详细记录了在Linux环境下编译安装PHP 5.2.14并启用FPM支持的过程,同时整合了Memcache客户端扩展及Memcached服务端组件。通过配置libevent库、应用fpm补丁以及调整php.ini,实现了高性能的PHP-FPM运行环境与分布式缓存功能的完整搭建。

2026.02.13 947
CentOS下安装Apache及依赖组件配置指南

在CentOS Basic Server环境下通过源码编译安装Apache 2.4.9时,常因缺失APR、APR-Util及PCRE等基础库导致configure报错。本文详细记录从下载稳定版httpd包开始,依次安装apr-1.5.1、apr-util-1.5.3和pcre-8.35的过程,并通过指定--with-apr、--with-pcre等参数解决依赖查找失败问题,最终完成Apache的编译启动及开机自启配置。

2026.11.13 931
Nginx编译安装及常用参数详解

本文介绍了基于Ansible Role自动化部署Nginx的方法,并详细解析了./configure编译安装过程中的各类参数。内容涵盖通用配置选项、默认开启与未开启的模块控制(如SSL、HTTP/2、Stream等)、Perl及邮件模块相关设置,帮助管理员根据需求定制Nginx功能。

2025.07.26 893
Aliyun Linux 编译安装 Tengine 2.3.2 详解

本文详细介绍在 Aliyun Linux 环境下编译安装 Tengine(Nginx 分支)的完整流程。涵盖编译环境准备,以及 PCRE、OpenSSL、Zlib、jemalloc 等核心依赖组件的安装配置。同时包含添加专用运行用户、执行 configure 编译参数设置,以及通过 systemd 配置开机自启和常用服务管理命令。

2025.12.13 853
PHP 7.0 Alpha 1 特性解析与编译安装指南

2026年6月11日,PHP官网正式公开发布PHP7第一版的alpha版本。该版本基于新版ZendEngine引擎,相比PHP 5.6性能提升两倍,并引入空接合操作符、标量类型声明等新特性。本文整理PHP 7.0 Alpha 1的安装笔记,涵盖mcrypt依赖、bison与re2c升级以及源码配置编译的具体命令。

2026.07.27 840

专题推荐

更多
PHP 类与对象定义及继承

先看类声明、对象实例与属性访问。理解对象的创建和销毁后,再读继承、方法重载和关键字对照。已有代码遇到继承行为差异时,可进一步查看 final 方法与反射实例。

PHP 定时任务配置与运行

先确定任务运行间隔以及是否允许重叠。固定时间触发先看 Cron 案例,框架内和常驻服务再读对应示例。

Yii2 队列配置与常驻运行

先用一个最小任务跑通入队和消费,再检查 Web 与 Console 是否加载了相同的队列配置。确认命令能手动运行后再配置 Supervisor,最后验证进程重启时的处理情况。

PHP Session 过期时间设置方法

浏览器关闭、服务端回收和业务规定的闲置超时,可能在不同时间发生。对照配置项与应用层时间戳的做法,检查会话何时仍可读、何时应要求重新登录。

PHP URL 编码和解码方法

URL 路径片段和查询参数对空格的处理方式不同。先比较 urlencode 与 rawurlencode,再沿解码过程核对中文、加号和百分号,检查地址是否被重复编码或提前解码。

在线工具箱

更多
键码查询
键码查询

按下键盘按键时查看浏览器记录的键名和事件信息。

.env 配置检查
.env 配置检查

本地检查 .env 键值语法、引号、重复键及空值,预览解析结果,辅助排查 PHP 和 Laravel 环境配置。

进制转换
进制转换

转换二进制、十进制、十六进制等数值表示,辅助程序调试与进制学习。

HTML 标签安全清理
HTML 标签安全清理

清理 HTML 片段中的标签或危险内容,辅助整理待展示的文本。

文件 Base64 转换
文件 Base64 转换

把文件转为 Base64 文本,也可将编码内容还原为文件,方便接口传输与调试。