Home >Backend Development >PHP Tutorial > [请问达人]关于php5和libiconv进行交叉编译的有关问题[急]

[请问达人]关于php5和libiconv进行交叉编译的有关问题[急]

WBOY
WBOYOriginal
2016-06-13 13:39:511510browse

[请教达人]关于php5和libiconv进行交叉编译的问题[急!!!]
项目要求重新编译php,把iconv库编译进去,我已经安装了iconv库了,但是等到编译php进行configure的时候,却总是说找不到iconv库,以前我没有接触过php的东西,所以实在是没招了,请大侠指教指教,多谢多谢!

我的操作步骤:(mips64平台)

1.安装libiconv-1.11.tar.gz

交叉编译工具已经export过了

./configure --prefix=/usr/local/iconv --host=mipsel-linux
make
make intall

完成这一步会在/usr/local/iconv下生成几个目录,readelf -h检查编译出来的iconv可执行文件是正确的(mips3000,64位)

2.将已经编译出来的库和.h文件拷到编译工具对应的库和include目录下

3.编译php
./configure --host=mipsel-linux --prefix=/usr/local/mips64/ -enable-force-cgi-redirect -enable-fastcgi -enable-sockets -with-gd -with-zlib -with-png -with-iconv-dir=/usr/local/iconv -disable-mbstring -with-xmlrpc -libdir=/usr/local/Cavium_Networks/OCTEON-SDK/tools/mips64-octeon-linux-gnu/sys-root/usr/lib64 -includedir=/usr/local/Cavium_Networks/OCTEON-SDK/tools/mips64-octeon-linux-gnu/sys-root/usr/include

这一步出错:

checking for libiconv in -liconv... no
checking for iconv in -liconv... no
configure: error: iconv not found, in order to build xmlrpc you need the iconv library

如果只是-with-iconv,可以configure过去,而且也能编译出来,但是显示phpinfo的时候iconv总是用的glibc的iconv。。。


------解决方案--------------------
帮你 ddddd
------解决方案--------------------
去掉 -with-xmlrpc,应该可以通过

或者检查一下 pkgconfig 有没有 libiconv.pc
------解决方案--------------------
那不就得了,locate libiconv.pc 一下.

把libiconv.pc 复制到/usr/lib/pkgconfig/

或者把所在path 加到 PKG_CONFIG_PATH 中去.

这样编译时就能找到了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn