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
我对PHP函数iconv有一些问题,我已经跟踪了iconv实现。如手册所述,“请注意,在某些系统上的iconv功能可能不像您期望的那样工作。在这种情况下,最好安装GNU libiconv库
I've downloaded the libiconv library from http://www.gnu.org/software/libiconv/ and installed it without any problems using:
我已经从http://www.gnu.org/software/libiconv/下载了libiconv库,并在没有任何问题的情况下安装了它:
$ ./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
我现在的问题是如何将这个安装链接到PHP?根据我所读到的内容,我需要重新编译PHP
--with-iconv-dir=/usr/local/
but how do I do this on CentOS? I installed php with
但是我怎么在CentOS上做这个呢?我安装了php与
yum install php.x86_64
I tried yum reinstall php but when I service httpd restart my phpinfo reads the same, glibc.
我尝试了yum重新安装php,但是当我服务httpd时,重新启动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?
有没有更好的方式来安装libiconv的CentOS?如果不是,我如何让PHP使用这个安装而不让yum不高兴呢?
Many thanks in advance
提前感谢
2 个解决方案
#1
1
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.
您应该手动重新编译php iconv扩展(在php-x.y中)。手动更改配置脚本后,强制它选择GNU libiconv而不是glibc的iconv。类似的堆栈问题请参见我的答案。
#2
2
compiled php from source seems to be the way
从源代码编译php似乎就是这样
php -m > /tmp/php.modules
to list of compiled module for php
php - m > / tmp / php。用于php编译模块列表的模块。
backup your current php.ini
备份您当前的php . ini
yum uninstall php
百胜卸载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)
下载php并基于您现有的模块+ iconv——几乎所有的步骤都在这里详细介绍:http://www.php.net/manual/en/install.unix.apache2.php#90478(除了从不建议您备份php.ini)
#1
1
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.
您应该手动重新编译php iconv扩展(在php-x.y中)。手动更改配置脚本后,强制它选择GNU libiconv而不是glibc的iconv。类似的堆栈问题请参见我的答案。
#2
2
compiled php from source seems to be the way
从源代码编译php似乎就是这样
php -m > /tmp/php.modules
to list of compiled module for php
php - m > / tmp / php。用于php编译模块列表的模块。
backup your current php.ini
备份您当前的php . ini
yum uninstall php
百胜卸载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)
下载php并基于您现有的模块+ iconv——几乎所有的步骤都在这里详细介绍:http://www.php.net/manual/en/install.unix.apache2.php#90478(除了从不建议您备份php.ini)