开发者

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 yum reinstall php but when I service httpd restart my phpinfo reads the same, 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-x.y.z/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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜