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

PHP开源脚本语言

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

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

报错1: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

解决方法:

[[email protected] php-5.3.27]# ln -s /application/mysql/lib/libmysqlclient.so.18  /usr/lib64/
[[email protected] 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后还是报错:

[[email protected] php-5.3.27]# cd  ext/phar/
[[email protected] phar]# cp ./phar.php  ./phar.phar
[[email protected] php-5.3.27]# pwd
/home/oldboy/tools/php-5.3.27
[[email protected] php-5.3.27]# make
Build complete.
Don‘t forget to run ‘make test‘.

终于不报错了。


nginx1.6.2-mysql5.5.32二进制,php安装报错解决:
[[email protected] 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:
[[email protected] 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
[[email protected] php-5.3.27]# echo "/usr/local/lib" >>/etc/ld.so.conf
[[email protected] php-5.3.27]# echo "/application/mysql-5.5.32/lib" >>/etc/ld.so.conf   
[[email protected] php-5.3.27]# tail -1 /etc/ld.so.conf
/application/mysql-5.5.32/lib
[[email protected] php-5.3.27]# ldconfig
[[email protected] 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:

有时候我们编译php的时候会出现以下错误:
make ***[libphp5.la] Error 1

处理方法:
安装两个rpm包#yum -y install libtool.i386 libtool-ltdl-devel.i386
clean下     #make clean
            #make

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

时间: 09-01

linux下编译安装php各种报错大集合的相关文章

(转)Linux下编译安装log4cxx

Linux下编译安装log4cxx 一个项目的服务器端在Linux平台下,用到了开源日志库log4cxx,这个库是apache项目的一个子库.功能很不错.下面记录下它的编译和安装过程. log4cxx的官方下载地址是http://logging.apache.org/log4cxx/index.html ,我用的是0.10.0版本. 为了编译它,还需要两个辅助库,apr,和apr-util,可以在这里下载http://apr.apache.org/download.cgi ,我用的版本分别是ap

Linux下编译安装qemu和libvirt

目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 2 安装libvirt 2.1 libvirt介绍 2.2 下载libvirt 2.3 编译安装 3 参考资料 KVM虚拟机(英语:Kernel-based Virtual Machine),是一种用于Linux内核中的虚拟化基础设施.KVM目前支援Intel VT及AMD-V的原生虚拟技术.KVM在2007年2月被导入Linux 2.6.20核心中.它也被引入FreeBSD.在Mac OS X中,

linux下编译安装boost库

转载:http://www.cnblogs.com/oloroso/p/4632848.html linux下编译安装boost库 linux下编译安装boost库 1.下载并解压boost 1.58 源代码 下载 解压 2.运行bootstrap.sh 3.使用b2进行构建 构建成功的提示 4.安装boost库到指定目录 5.测试一下 代码 编译运行 先看一下系统环境 Linux o-pc 3.19.0-22-generic #22-Ubuntu SMP Tue Jun 16 17:15:15

linux下编译安装nginx

1.首先下载稳定版nginx1.10.2 使用wget命令下载 wget http://nginx.org/download/nginx-1.10.2.tar.gz 2.然后解压 tar -zxvf nginx-1.10.2.tar.gz 3.安装依赖库 sudo apt-get install libpcre3-dev aptitude libssl-dev sudo apt-get install openssl sudo apt-get install libssl0.9.8 sudo a

Centos6.3 PHP编译安装JSON模块报错解决

我在搭建监控系统时候出现JSON模块安装失败,PHP5.3  系统Centos6.3,安装json报错 ZVAL_DELREF 符号未知错误... # Warning: PHP Startup: Unable to load dynamic library '/home/json/json-1.2.1/modules/json.so' - /home/json/json-1.2.1/modules/json.so: undefined symbol: ZVAL_DELREF in Unknown

Linux 下编译安装xDebug命令速记

下载xdebug-2.2.4.tgz软件链接: http://pan.baidu.com/s/1jGHYRMA #解压 xdebugtar -zxvf xdebug-2.2.4.tgz #进入xdebug源代码目录cd xdebug-2.2.4 #执行 phpize 配置/pathto-php/bin/phpize #开始安装配置./configure --prefix=/pathto-php/lib/php/extensions \--with-php-config=/pathto-php/b

linux 下编译安装php

系统环境: CentOS 6.5 x86_64 下载 PHP 源码包 # wget http://cn2.php.net/distributions/php-5.5.9.tar.bz2 # tar xf php-5.5.9.tar.bz2 -C /usr/local/src/ 添加 epel 源 # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 安装依赖 # yum insta

Linux 下编译安装xCache命令速记

注意要先确保/path-to-php/bin/php-config存在下载链接: http://pan.baidu.com/s/1hqh5pDM #解压xcache源代码tar -zvxf xcache-3.1.0.tar.gz #进入安装目录cd xcache-3.1.0 #安装前执行phpize配置/path-to-php/bin/phpize #安装配置 ./configure --prefix=/path-to-php/lib/php/extensions \--with-php-con

linux下编译安装memcached服务实例教程

分享下linux下编译安装memcached服务的步骤,一起来看看. 系统:Ubuntu 13.10第一步:安装libevent-dev$aptitude search libevent-dev$aptitude install libevent-dev 第二步:下载memcached并安装(www.jbxue.com)官网地址:http://memcached.org/$wget -c http://www.memcached.org/files/memcached-1.4.17.tar.gz