简体   繁体   中英

PHP ICONV glibc to libiconv on CentOS 5.5

I'm having a few issues with the PHP function iconv, which I've tracked down the the iconv implementation. As the manual states, "Note that the iconv function on some systems may not work as you expect. In such case, it'd be a good idea to install the GNU libiconv library." http://uk3.php.net/manual/en/intro.iconv.php

I've downloaded the libiconv library from http://www.gnu.org/software/libiconv/ and installed it without any problems using:

$ ./configure --prefix=/usr/local
$ make
$ make install

My problem now is how to link this installation to PHP? From what i've read I need to recompile PHP with

--with-iconv-dir=/usr/local/

but how do I do this on CentOS? I installed php with

yum install php.x86_64

I tried but when I my phpinfo reads the same, glibc . 但是当我我的phpinfo读取相同, glibc

Is there a better way to install libiconv on CentOS? If not how do I get PHP using this installation without upsetting yum?

Many thanks in advance

compiled php from source seems to be the way

php -m > /tmp/php.modules to list of compiled module for php

backup your current php.ini

yum uninstall php

download the php and base on your existing module + iconv - almost all steps has been detailed here : http://www.php.net/manual/en/install.unix.apache2.php#90478 (except never advise u to backup php.ini)

You should manually recompile the php iconv extension (in the php-xyz/ext/iconv/ subdirectory) after manual changing of the configure script to force it to select GNU libiconv instead of glibc's iconv. See my answer for the similar Stack question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM