php5.6.15编译遇到的问题

4790阅读 0评论2015-11-14 qingheliu
分类:LINUX

在使用php5.6.15 configure和make时遇到问题!
1:在编译fontconfig时有错:
fontconfig configure error package requirements (freetype2) were not met
其实我已经将freetype版本安装了!
解决方法:
export PKG_CONFIG_PATH=/usr/local/freetype/lib/pkgconfig
 即可!
2:
/home/liuxiaojie/install/fontconfig-2.11.1/fc-cache/.libs/lt-fc-cache: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
make[2]: *** [install-data-local] Error 127
make[2]: Leaving directory `/home/liuxiaojie/install/fontconfig-2.11.1'
安装的时候报错:
解决方法:
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig -v
然后make install 即可成功!

3:Don't know how to define struct flock on this system, set --enable-opcache=no
这个纠缠了我好久,网上的方法我测试没一个成功的!
于是我在configure的时候加入了--enable-opcache=no 的确是可以configure过去了!
显然如果不支持opcache,php性能会下降很多,这肯定是接受不了的!
于是我想到另外一个方法将opcache 作为一个扩展安装,这样安装的时候没遇到问题!
一切是正常的! 

4:
In file included from /usr/local/packages/php-5.6.15/ext/zip/lib/zip_add.c:37:
/usr/local/packages/php-5.6.15/ext/zip/lib/zipint.h:118:2: error: #error unsupported size of off_t
make: *** [ext/zip/lib/zip_add.lo] Error 1
这个问题也很郁闷, 它是在make阶段出的问题(在configure阶段一切正常!)
主要是加了--enable-zip,去掉这个就不报错,但又必须得加上
我也是采用了比较迂回的策略,在configure的时候将--enable-zip 参数给去掉,
将zip作为php的扩展安装,作为扩展安装的时候没遇到问题!

5:
/usr/local/src/php-5.6.15/ext/gd/gd.c:57:22: error: X11/xpm.h: No such file or directory
make: *** [ext/gd/gd.lo] Error 1
原因:这是提示没有安装libXpm库,是在安装gd2库的时候没有配置开启
见附件:

在安装gd的时候是没有报错的(尽管不支持libXpm),结果在php安装的时候报错,只好安装libXpm,然后重新编译gd,
重新安装php,就没有这个报错了!

5:安装camke时也遇到了一个问题;
CMake Error at cmake/readline.cmake:291 (MESSAGE):
  WITH_EDITLINE must be bundled or system
Call Stack (most recent call first):
  CMakeLists.txt:417 (MYSQL_CHECK_EDITLINE
解决方法: yum  -y install  readline-devel

6: + perl version: This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.

./configure: error: perl module ExtUtils::Embed is required

yum -y install perl-devel perl-ExtUtils-Embed

上一篇:redis-port [PANIC] read error
下一篇:InnoDB: Error: Table “mysql”.”innodb_table_stats” not found.