对于记录……这是您向OS X Lion添加gettext的方法
安装ICU
运行这些命令
tar xzvf icu4c-4_8_1-src.tgz
cd icu/source
./runConfigureICU MacOSX
make
sudo make install
运行这些命令
tar -zxf php-5.3.6.tar.gz
cd ext/intl
phpize
./configure --enable-intl
make
sudo cp modules/intl.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
把它放在你的php.ini文件中
extension=intl.so
安装Gettext
运行这些命令
tar -zxf gettext-0.18.1.1.tar.gz
cd gettext-0.18.1.1
Apple will not ship Gettext and Intl the problem is that Gettext apparently defines Stpncpy function, as does something in Lion.
您需要打开gettext-tools / gnulib-lib / stpncpy.c并将stpncpy的所有引用更改为stpncpy2
然后运行这些命令
./configure
make
sudo make install
回到PHP源目录:
运行这些命令
cd ext/gettext
phpize
./configure --with-gettext
make
sudo cp modules/gettext.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
并将其添加到php.ini文件中:
extension=gettext.so