《转》 PHP编译configure时常见错误

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群版 2核4GB 100GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

PHP的安装虽然有时候很简单,可是如果应用一多,我们安装起来就很头痛了!出错最多的就是安装PHP扩展的时候了。其实不管是你是Apache类的应用还是Nginx类的,PHP的安装都不是很简单,虽然网上有很多configure参数,但是那不一定是适合你的,因为很多都直接关系着你的系统版本和内核。因此要自己亲自不断的调试,才能完全安装成功。

本文总结了一些常见的configure错误信息和解决这些错误的经验。

1、configure: error: No curses/termcap library found

网上有的说法是:–with-named-curses-libs=/usr/lib/libncursesw.so.5
其实是不对的,虽然能解决configure的错误,但是make的时候会提示错误,正确的做法应该是

1
2
centos: yum -y install ncurses-devel
debian: apt-get install libncurses5-dev

2、configure: error: xml2-config not found. Please check your libxml2 installation.

1
2
centos: yum -y install libxml2 libxml2-devel
debian: apt-get install libxml2-dev

3、configure: error: Cannot find OpenSSL’s

1
centos: yum -y install openssl-devel

4、configure: error: libjpeg.(a|so) not found

1
2
3
centos: yum -y install gd
centos: yum -y install gd-devel
debian: apt-get install libjpeg-dev

5、configure: error: libpng.(a|so) not found.

1
apt-get install libpng12-dev

6、configure: error: cannot find output from lex; giving up

1
yum -y install flex

7、configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

1
2
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev

8、configure: error: libxpm.(a|so) not found.

1
2
centos: yum -y install libxpm-dev
debian: apt-get install libxpm-dev

9、configure: error: freetype.h not found.

1
2
centos: yum install freetype-devel
debian: apt-get install libfreetype6-dev

10、configure: error: …No recognized SSL/TLS toolkit detected

1
2
centos: yum -y install libssl-dev
debian: apt-get install libssl-dev

11、Configure: error: Please reinstall the BZip2 distribution

1
2
centos: yum install bzip2 bzip2-devel
debian: apt-get install bzip2-devel

12、Configure: error: Please reinstall the libcurl distribution – easy.h should be in /include/curl/
centos: yum install curl curl-devel (For Redhat & Fedora)

1
# install libcurl4-gnutls-dev (For Ubuntu)

13、Configure: error: Unable to locate gmp.h

1
centos: yum install gmp-devel

14、Configure: error: Cannot find MySQL header files under /usr. Note that the MySQL client library is not bundled anymore!

1
2
yum install mysql-devel (For Redhat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)

15、Configure: error: Please reinstall the ncurses distribution
Solutions :

1
centos: yum install ncurses ncurses-devel

16、Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Solutions :

1
centos: yum install unixODBC-devel

17、Configure: error: Cannot find pspell
Solutions :

1
centos: yum install pspell-devel

18、configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :

1
2
yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev

19、Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :

1
yum install net-snmp net-snmp-devel

20、开启LDAP服务还需要

1
yum -y install openldap-devel openldap-servers openldap-clients

21、configure: error: cannot find output from lex; giving up

1
centos: yum -y install flex

22、configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

1
2
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev



本文转自 1inux 51CTO博客,原文链接:http://blog.51cto.com/1inux/1655594
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
10月前
|
开发框架 应用服务中间件 PHP
Mac Nginx 关联 php 详细配置以及常见错误
Mac Nginx 关联 php 详细配置以及常见错误
161 1
|
1月前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
26 1
|
2月前
|
前端开发 PHP
IIS发布PHP网站常见错误:字体库404
笔者最近在用IIS发布php网站时,前端出现了字体库文件404的错误,关于这个问题,尝试了很多办法,最终发现是字体文件类型不被IIS识别导致的,解决方法是在config文件中添加映射配置,下面我就来详细介绍下。
64 5
|
自然语言处理 PHP
PHP的编译过程是怎样的?底层原理是什么?
PHP的编译过程是怎样的?底层原理是什么?
157 0
|
11月前
编译php7常见报错
编译php7常见报错
|
自然语言处理 PHP
Zend 引擎首先将 PHP 代码编译为中间代码,中间代码是干什么的?底层原理是什么?
Zend 引擎首先将 PHP 代码编译为中间代码,中间代码是干什么的?底层原理是什么?
135 0
php7 编译 No package 'libzip' found
php7 编译 No package 'libzip' found
566 0
|
关系型数据库 Shell C++
debian12/ubuntu24/22/20 shell 脚本自动编译web安装网站环境 nginx1.26.0 php7/8 mariadb1011
1.ubuntu 搭建 nginx199 php-fpm7/8 mariadb10.11 c++ cgi-bin 2.mysql 重置 root 密码,创建 或删除 mysql 子库和子用户 3. ubuntu 搭建 c++ cgi-bin 4.自动生成 wwwconf 子站点 5. 建议选择 ubuntu20.04 版本
380 0
|
关系型数据库 MySQL PHP
Php的编译与配置| 学习笔记
快速学习Php的编译与配置。
106 0
|
Shell 开发工具 C语言
php-7.3.13 configure: error: Please reinstall the libzip distribution
php-7.3.13 configure: error: Please reinstall the libzip distribution
222 0
php-7.3.13 configure: error: Please reinstall the libzip distribution