简体   繁体   English

在ICOS 5.5上使用PHP ICONV glibc到libiconv

[英]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. 我在使用PHP函数iconv时遇到了一些问题,我已经跟踪了iconv实现。 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." 正如手册所述,“请注意,某些系统上的iconv功能可能无法正常工作。在这种情况下,安装GNU libiconv库是个好主意。” http://uk3.php.net/manual/en/intro.iconv.php 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: 我从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? 我现在的问题是如何将此安装链接到PHP? From what i've read I need to recompile PHP with 从我读过的,我需要重新编译PHP

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

but how do I do this on CentOS? 但我如何在CentOS上这样做呢? I installed php with 我安装了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? 有没有更好的方法在CentOS上安装libiconv? If not how do I get PHP using this installation without upsetting yum? 如果不是如何在不沮丧yum的情况下使用此安装获取PHP?

Many thanks in advance 提前谢谢了

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.modules到php的已编译模块列表

backup your current php.ini 备份你当前的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) 下载PHP并基于您现有的模块+ iconv - 几乎所有步骤都在这里详细说明: http//www.php.net/manual/en/install.unix.apache2.php#90478 (除非建议您备份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. 在手动更改configure脚本后,您应手动重新编译php iconv扩展(在php-xyz/ext/iconv/子目录中),以强制它选择GNU libiconv而不是glibc的iconv。 See my answer for the similar Stack question. 见我回答了类似的协议栈的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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