本专题主题收集PHP编译过程中的错误及其解决方案。
1、编译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
--------------------------------------------------------------------
2、重新构造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
--------------------------------------------------------------------
3、编译时缺少库
configure: error: libXpm.(a|so) not found.
解决方法:yum install libXpm-devel
--------------------------------------------------------------------
4、编译时缺少gmp.h文件
configure: error: Unable to locate gmp.h
解决方法:yum install gmp-devel
--------------------------------------------------------------------
5、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)
--------------------------------------------------------------------
6、Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
解决方法:
#yum install openssl openssl-devel
--------------------------------------------------------------------
7、Configure: error: Please reinstall the BZip2 distribution
解决方法:
# yum install bzip2 bzip2-devel
--------------------------------------------------------------------
8、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)
--------------------------------------------------------------------
9、Configure: error: libjpeg.(also) not found.
解决方法:
# yum install libjpeg libjpeg-devel
--------------------------------------------------------------------
10、Configure: error: libpng.(also) not found.
--------------------------------------------------------------------
解决方法:
# yum install libpng libpng-devel
--------------------------------------------------------------------
11、Configure: error: freetype.h not found.
解决方法:
#yum install freetype-devel
--------------------------------------------------------------------
12、Configure: error: Unable to locate gmp.h
解决方法:
# yum install gmp-devel
--------------------------------------------------------------------
13、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)
--------------------------------------------------------------------
14、Configure: error: Please reinstall the ncurses distribution
解决方法:
# yum install ncurses ncurses-devel
--------------------------------------------------------------------
15、Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
解决方法:
# yum install unixODBC-devel
--------------------------------------------------------------------
16、Configure: error: Cannot find pspell
解决方法:
# yum install pspell-devel
--------------------------------------------------------------------
17、configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:
# yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev
--------------------------------------------------------------------
18、Configure: error: snmp.h not found. Check your SNMP installation.
解决方法:
# yum install net-snmp net-snmp-devel
--------------------------------------------------------------------
19、configure:error:Cannot find ldap.h
解决方法:
#yum install openldap-devel openldap
20、configure:error:xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决方法:
#yum install libxslt libxslt-devel
21、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即可
22、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'
23、configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.
yum install libc-client-devel
24、libiconv相关的未定义引用
/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'
/usr/local/src/php-5.2.17/ext/iconv/iconv.c:2615: undefined reference to `libiconv'
/usr/local/src/php-5.2.17/ext/iconv/iconv.c:2537: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor':
/usr/local/src/php-5.2.17/ext/iconv/iconv.c:2491: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
原因:可能是由于系统中手工编译了libiconv
解决办法:
./configure ............
vi Makefile
找到下面这行:
EXTRA_LIBS = -lcrypt ...在最后添加-liconv保存
make
make instal
本日志由 flyinweb 于 2012-01-11 15:48:36 发表,目前已经被浏览 243 次,评论 0 次;
作者添加了以下标签: PHP compile errors;
引用通告:http://www.517sou.net/Article/750/Trackback.ashx
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱
http://www.2mysite.net/scriptencoder/screnc.asp 站长你好,看
你好,我发现一个问题,就是从mysqld2同步过来的数据,在mysqld1的
晕,我说是怎么回事情,原来我和你一样,忘记设置了活动分区