• 安装php时,make步骤报错make: *** [sapi/fpm/php-fpm] Error 1


    安装PHP过程中,make步骤报错:(集中网络上各种解决方法)

    (1)
    -liconv -o sapi/fpm/php-fpm

    /usr/bin/ld: cannot find -liconv

    collect2: ld returned 1 exit status

    make: *** [sapi/fpm/php-fpm] Error 1

    [root@localhost php-5.4.5]#


    初步定位是iconv的问题
    解决方法 把libiconv卸载掉
    进入libiconv源码目录执行
    #make uninstall
    #make clean

    # ./configure –prefix=/usr/local/libiconv
    # make
    # make install

    在进入php源码目录

    ./configure php时加上参数--with-iconv=/usr/local/libiconv

    (2)
    /usr/bin/ld: cannot find -lltdl
    collect2: ld returned 1 exit status
    make: *** [sapi/cgi/php-cgi] Error 1
    解决办法:安装包 yum install libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64

    (3)
    collect2: ld returned 1 exit status
    make: *** [sapi/cgi/php-cgi] Error 1

    解决办法:

    请安装lib所需的安装包

    yum install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel kernel

    执行安装完以后即可解决问题

    make

    make install

    (4)
    装php环境出现

    ext/iconv/iconv.o: In function `php_iconv_stream_filter_ctor’:
    /usr/local/soft/php-5.2.14/ext/iconv/iconv.c:2491: undefined reference to `libiconv_open’
    collect2: ld returned 1 exit status
    make: *** [sapi/cgi/php-cgi] Error 1

    我的编译是这样:

    ./configure –prefix=/usr/local/php –with-gd=/usr/local/gd –with-jpeg-dir=/usr/local/jpeg –with-png-dir=/usr/local/png –with-freetype-dir=/usr/local/freetype –with-mysql=/usr/local/mysql –enable-fastcgi –enable-fpm

    解决办法:

    增加 – - disable-cli

    (5)
    编译php时
    ext/xmlreader/php_xmlreader.o: In function `zim_xmlreader_XML':
    /usr/local/src/php-5.2.8/ext/xmlreader/php_xmlreader.c:1109: undefined reference to `xmlTextReaderSetup'
    collect2: ld returned 1 exit status
    make: *** [sapi/cgi/php-cgi] Error 1
    解决办法:折腾了半天,最后先make clean 一下,然后把所有libxml2相关的包都装上重新编译就ok了。

    (6)
    运行可能报错 :我遇到xsl和mcrypt两个库报错,重新安装一下xsl的dev包就可以:
    CentOS : yum install libxslt-devel libmcrypt-devel
    Debian : apt-get install libxslt1-dev libmcrypt-dev
    如果你有其他的库不满足,搜索一下该库,安装一下即可,这一步应该没有太多问题。
    编译:
    make
    我在Debian下make正常,但在CentOS下却提示make错误,
    make: *** [sapi/fpm/php-fpm] Error 1 错误中出现 libiconv,应该是iconv包问题,
    使用下面的命令替换即可:
    make ZEND_EXTRA_LIBS='-liconv'
    完成后:
    make test
    make install

  • 相关阅读:
    2.创建第一个启用了服务和数据驱动的silverlight5应用程序
    1.搭建siverlight 5开发环境
    读《C程序设计语言》笔记1
    读《C程序设计语言》笔记2
    郑州轻工业大学OJ 2834.小凯的书架 题解 线段树二分
    洛谷P3834 【模板】可持久化线段树 2/POJ2104 Kth Number 题解 主席树
    洛谷P6883 [COCI20162017#3] Kroničan 题解 状压DP入门题
    CF1586D. Omkar and the Meaning of Life 题解 纪念一下第一道AC的交互题
    冒泡事件
    JavaScript 对象是词典
  • 原文地址:https://www.cnblogs.com/fjping0606/p/4760479.html
Copyright © 2020-2023  润新知