解决 libiconv.so.2: cannot open shared object file 的错误

今天给VPS编译PHP,提示

 libiconv.so.2: cannot open shared object file

一般这个错误会出现在 64位平台上,我的刚好是 CentOS 5.4 64bit

解决办法如下

1.将 /usr/local/lib 加入到 /etc/ld.so.conf

2.运行 /sbin/ldconfig