0

php-5.2.10编译错误及解决方法

已有 171 阅读此文人 - - Linux,系统管理 -

编译参数:

./configure \
    "--prefix=/usr/local/php " \
    "--with-apxs2=/usr/local/apache2/bin/apxs " \
    "--with-config-file-path=/usr/local/php/etc " \
    "--enable-discard-path " \
    "--enable-force-cgi-redirect " \
    "--with-mysql=/usr/local/mysql " \
    "--with-mysqli=/usr/local/mysql/bin/mysql_config " \
    "--with-iconv-dir " \
    "--with-freetype-dir " \
    "--with-jpeg-dir " \
    "--with-png-dir " \
    "--with-gd " \
    "--with-zlib " \
    "--with-libxml-dir " \
    "--with-curl " \
    "--with-curlwrappers " \
    "--with-openssl " \
    "--with-mhash " \
    "--with-xmlrpc " \
    "--with-mcrypt " \
    "--with-ldap " \
    "--with-ldap-sasl " \
    "--enable-xml " \
    "--disable-rpath " \
    "--enable-discard-path " \
    "--enable-safe-mode " \
    "--enable-bcmath " \
    "--enable-shmop " \
    "--enable-sysvsem " \
    "--enable-inline-optimization " \
    "--enable-mbregex " \
    "--enable-mbstring " \
    "--enable-gd-native-ttf " \
    "--enable-ftp " \
    "--enable-pcntl " \
    "--enable-sockets " \
    "--enable-zip " \
    "--disable-debug " \
    "--disable-ipv6"
make ZEND_EXTRA_LIBS='-liconv'
make install

出现错误:

Fatal error: Error: cannot open phar
"/root/soft/php-5.2.10/pear/install-pear-nozlib.phar" in
/path/php-5.2.10/pear/install-pear-nozlib.phar on line 795
make<1>: ***  Error 255
make: ***  Error 2

解决方法:

编译参数里面加入:
--without-pear

安装好php以后,如果需要装pear,直接安装二进制的pear。
例如,按下面的方法:
curl http://pear.php.net/go-pear | /usr/local/php/bin/php

期待你一针见血的评论,Come on!

不用想啦,马上 "登录"  发表自已的想法.