在默认 Mac OS X Leopard 捆绑 PHP 配置上安装/启用 PHP Pecl Intl 扩展
如何在我的 PHP 环境中安装或启用 PHP Pecl Intl 扩展?
我有一个与 Mac OS X Snow Leopard 捆绑在一起的库存 PHP 配置。 从源代码安装 libicu 并 $pecl install intl
会导致以下错误:
/private/tmp/pear/temp/intl/collator/collator_class.c:92: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:96: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:101: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:107: error: duplicate 'static'
make: *** [collator/collator_class.lo] Error 1
ERROR: `make' failed
非常感谢任何帮助!
How can I install or enable the PHP Pecl Intl extension in my PHP environment?
I've got a stock PHP configuration that came bundled with Mac OS X Snow Leopard.
Installing libicu from source and than $pecl install intl
results in the following error:
/private/tmp/pear/temp/intl/collator/collator_class.c:92: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:96: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:101: error: duplicate 'static'
/private/tmp/pear/temp/intl/collator/collator_class.c:107: error: duplicate 'static'
make: *** [collator/collator_class.lo] Error 1
ERROR: `make' failed
Any help is really appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
以下是我在 OSX 10.9 Mavericks 中所做的操作:
使用 Homebrew 安装一些依赖项:
安装并验证 Pear/PECL(来自http://techtastico.com/post/ como-instalar-pear-y-pecl-en-os-x-mavericks/):
安装 PECL intl:
Here's what I did in OSX 10.9 Mavericks:
Install some dependencies with Homebrew:
Install and verify Pear/PECL (instructions from http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/):
Install PECL intl:
目前我已经重新编译了我的 PHP 安装。我已经使用我的配置字符串创建了 gist ,我将不断更新该字符串。update
< a href="http://php-osx.liip.ch/" rel="nofollow">liip 创建了一个很好的二进制文件,可以避免所有这些麻烦。它基于原始的 entropy.ch 二进制文件,我建议使用它进行 PHP 开发在 Mac 上。
For the time being I've recompiled my PHP installation. I've created a gist with my configure string which I'll keep updating.update
liip have created a nice binary that circumvents all these troubles. It is based on the original entropy.ch binary, I recomend using it for PHP development on a Mac.
迟到总比不到好,但如果您像我一样直接从 php.net 安装 PHP(而不是使用 Homebrew 或 Port 之类的东西,那么您可以简单地按照以下链接安装 Pear 和 PECL:
http://akrabat.com/php/setting-up-php -mysql-on-os-x-10-7-lion/
对我来说效果很好。
Better late than never, but if you are like me and installed PHP directly from php.net (instead of using something like Homebrew or Port, then you can simply follow the following link to install Pear and PECL:
http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/
It worked fine for me.
在我的Mac上,我使用brew安装了带有pear的php版本。这解决了我的所有问题,因为在尝试了许多不同的方法后,默认的 osX php 对我不起作用。如果您已经安装了 php/pear,则可以尝试不安装 php/pear。
您需要 Homebrew http://brew.sh/
安装 PHP
brew install php56 --with-pear< /code> 或
brew install php56 pear
安装 autoconf
brew install autoconf
安装 icu4c
brew install icu4c
创建符号链接
brew link --force icu4c
使用 (pearl) pecl 安装 intl
sudo pecl install intl
Homebrew 应该启用 intl 并将所有正确版本符号链接到各自的命令。
on my Mac I installed a php version with pear using brew. This solved all my issues as the default osX php didn't work for me after trying many different ways. You can try without installing php/pear if you have already done so.
You need Homebrew http://brew.sh/
Install PHP
brew install php56 --with-pear
orbrew install php56 pear
Install autoconf
brew install autoconf
Install icu4c
brew install icu4c
Creates the symlinks
brew link --force icu4c
Install intl with (pearl) pecl
sudo pecl install intl
Homebrew should enable intl and symlink all the right versions to their respective commands.