linux下编译安装php各种报错大集合

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

PHP开源脚本语言

PHP(外文名: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,入门门槛较低,易于学习,使用广泛,主要适用于Web开发领域。PHP的文件后缀名为php。

本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下。

报错1:make 后报错如下:

1
2
3
Generating phar.php
/home/oldboy/tools/php-5 .3.27 /sapi/cli/php : error  while  loading shared libraries: libmysqlclient.so.18: cannot  open  shared object  file : No such  file  or directory
make : *** [ext /phar/phar .php] 错误 127

解决方法:

1
2
3
4
5
6
7
[root@inode1 php-5.3.27] # ln -s /application/mysql/lib/libmysqlclient.so.18  /usr/lib64/
[root@inode1 php-5.3.27] # make
Generating phar.phar
chmod : 无法访问 "ext/phar/phar.phar" : 没有那个文件或目录
make : [ext /phar/phar .phar] 错误 1 (忽略)
Build complete.
Don 't forget to run ' make  test '.

make后还是报错:

1
2
3
4
5
6
7
[root@inode1 php-5.3.27] # cd  ext/phar/
[root@inode1 phar] # cp ./phar.php  ./phar.phar
[root@inode1 php-5.3.27] # pwd
/home/oldboy/tools/php-5 .3.27
[root@inode1 php-5.3.27] # make
Build complete.
Don 't forget to run ' make  test '.

终于不报错了。



nginx1.6.2-mysql5.5.32二进制,php安装报错解决:
[root@client php-5.3.27]#make
...
...
Generating phar.php
/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] 错误 127

报错:
解决1:
[root@client php-5.3.27]# find / -name "libmysqlclient.so.18"
/home/oldboy/tools/mysql-5.5.32-linux2.6-x86_64/lib/libmysqlclient.so.18
/application/mysql-5.5.32/lib/libmysqlclient.so.18
[root@client php-5.3.27]# echo "/usr/local/lib" >>/etc/ld.so.conf
[root@client php-5.3.27]# echo "/application/mysql-5.5.32/lib" >>/etc/ld.so.conf   
[root@client php-5.3.27]# tail -1 /etc/ld.so.conf
/application/mysql-5.5.32/lib
[root@client php-5.3.27]# ldconfig
[root@client php-5.3.27]# make
Generating phar.phar
chmod: 无法访问"ext/phar/phar.phar": 没有那个文件或目录
make: [ext/phar/phar.phar] 错误 1 (忽略)
Build complete.
Don't forget to run 'make test'.
解决:mkdir ext/phar/phar.phar -p

问题:make报错
/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] 错误 127

解决办法:
ln -s /application/mysql/lib/libmysqlclient.so.18  /usr/lib64/

报错:
/home/oldboy/tools/php-5.3.27/ext/xmlrpc/libxmlrpc/encodings.c:81: undefined reference to `libiconv'
/home/oldboy/tools/php-5.3.27/ext/xmlrpc/libxmlrpc/encodings.c:101: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1
解决办法:
make ZEND_EXTRA_LIBS='-liconv'


精典错误
/libxmlrpc/encoding.c:101:undefined reference to 'libiconv_close'
collect2: ld returned 1 exit status
make:*** [sapi/fpm/php-fpm] Error 1
解决方法:
#make ZEND_EXTRA_LIBS='-liconv'
错误一、编译php出错
/php-5.3.2/ext/fileinfo/libmagic/apprentice.c:147:internal compiler error:Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible,so it is likely a hardware or OS problem.
make:*** [ext/fileinfo/libmagic/apprentice.lo] Error 1
解决方法:内存大于1G即可,这是php5.3.2的一个bug

错误二、重新构造configure文件出错
./buildconf --force
Forcing buildconf
buildconf:checking installation...
buildconf:autoconf version 2.59 (ok)
buildconf:Your version of autoconf likely contains buggy cache code.
      Running vcsclean for you.
      To avoid this,install autoconf-2.13.
Can't figure out your VCS, not cleaning.
解决方法:编译安装autoconf-2.13
      再将autoconf-2.13的auotconf文件至/usr/local/autoconf
--------------------------------------------------------------------
错误三、编译时缺少库
configure: error: libXpm.(a|so) not found.
解决方法:yum install libXpm-devel
--------------------------------------------------------------------
错误四、编译时缺少gmp.h文件
configure: error: Unable to locate gmp.h
解决方法:yum install gmp-devel

--------------------------------------------------------------------
错误五
Configure: error: xml2-config not found. Please check your libxml2 installation.
解决方法:
#yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev      (For ubuntu)
--------------------------------------------------------------------
错误六
Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
解决方法:
#yum install openssl openssl-devel
--------------------------------------------------------------------
错误七
Configure: error: Please reinstall the BZip2 distribution
解决方法:
# yum install bzip2 bzip2-devel
--------------------------------------------------------------------
错误八
Configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解决方法:
# yum install curl curl-devel   (For Redhat & Fedora)
# install libcurl4-gnutls-dev    (For Ubuntu)
--------------------------------------------------------------------
 
错误九:
Configure: error: libjpeg.(also) not found.
解决方法:
# yum install libjpeg libjpeg-devel
--------------------------------------------------------------------
错误十
Configure: error: libpng.(also) not found.
--------------------------------------------------------------------
解决方法:
# yum install libpng libpng-devel
--------------------------------------------------------------------
错误十一
Configure: error: freetype.h not found.
解决方法:
#yum install freetype-devel
--------------------------------------------------------------------
错误十二
Configure: error: Unable to locate gmp.h
解决方法:
# yum install gmp-devel
--------------------------------------------------------------------
错误十三
Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
解决方法:
# yum install mysql-devel            (For Redhat & Fedora)
# apt-get install libmysql++-dev      (For Ubuntu)
--------------------------------------------------------------------
 
错误十四
Configure: error: Please reinstall the ncurses distribution
解决方法:
# yum install ncurses ncurses-devel
--------------------------------------------------------------------
错误十五
Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
解决方法:
# yum install unixODBC-devel
--------------------------------------------------------------------
错误十六
Configure: error: Cannot find pspell
解决方法:
# yum install pspell-devel
--------------------------------------------------------------------
错误十七
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:
# yum install libmcrypt libmcrypt-devel    (For Redhat & Fedora)
# apt-get install libmcrypt-dev
--------------------------------------------------------------------
错误十八
Configure: error: snmp.h not found. Check your SNMP installation.
解决方法:
# yum install net-snmp net-snmp-devel
--------------------------------------------------------------------
错误十九
configure:error:Cannot find ldap.h
解决方法:
#yum install openldap-devel openldap
错误二十
configure:error:xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决方法:
#yum install libxslt libxslt-devel

错误二十一
checking for libevent >=1.4.11 install prefix... configure: error: Could not find libevent >=1.4.11 in /usr/local/php
解决方法:
安装libevent-1.4.11以上版本至/usr/local
tar xzvf libevent-1.4.14-stable.tar.gz
cd libevent-1.4.14-stable
./configure --prefix=/usr/local
make&&make install
在编译./configure时添加--with-libevent-dir=/usr/local即可

错误二十二

cc1: out of memory allocating 2036 bytes after a total of 81846272 bytes
make: *** [ext/date/lib/parse_date.lo] Error 1

报错:
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make:*** [sapi/fpm/php-fpm] Error 1
解决方法:
安装ltdl
#cd ../libmcrypt-2.5.7/libltdl/
#./configure --enable-ltdl-install
#ldconfig
#cd php-5.3.6
#make ZEND_EXTRA_LIBS='-liconv'
done s


错误23:

1
2
3
4
5
6
7
有时候我们编译php的时候会出现以下错误:
make  ***[libphp5.la] Error 1
 
处理方法:
安装两个rpm包 #yum -y install libtool.i386 libtool-ltdl-devel.i386
clean下      #make clean
             #make

wKioL1mryzbAtTAlAAB0Ab-Z9bY247.jpg


http://www.phperz.com/article/14/1207/39774.html

本文转自sandshell博客51CTO博客,原文链接http://blog.51cto.com/sandshell/1962327如需转载请自行联系原作者


sandshell

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
6天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
43 0
|
6天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
23 0
|
6天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
13 0
|
6天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
27 0
|
18天前
|
Java Linux Maven
Linux中安装MAVEN环境配置
Linux中安装MAVEN环境配置
42 3
|
19天前
|
存储 负载均衡 索引
linux7安装elasticsearch-7.4.0集群配置
linux7安装elasticsearch-7.4.0集群配置
108 0
|
23天前
|
Linux 数据安全/隐私保护 虚拟化
Linux技术基础(1)——操作系统的安装
本文是龙蜥操作系统(Anolis OS) 8.4 的安装指南,用户可以从[龙蜥社区下载页面](https://openanolis.cn/download)获取ISO镜像。安装方法包括物理机的光驱和USB闪存方式,以及虚拟机中的VMware Workstation Pro设置。安装过程涉及选择语言、配置安装目标、选择软件集合和内核,设置Root密码及创建新用户。安装完成后,可通过文本模式或图形化界面验证系统版本,如Anolis OS 8.4,标志着安装成功。
|
19天前
|
消息中间件 Java Linux
Linux下RabbitMQ安装与使用
Linux下RabbitMQ安装与使用
32 1
|
24天前
|
监控 Shell Linux
【Shell 命令集合 系统管理 】Linux 显示当前登录到系统的用户信息 who命令 使用指南
【Shell 命令集合 系统管理 】Linux 显示当前登录到系统的用户信息 who命令 使用指南
42 1
|
6天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
14 1