macOS Sierra安装PHP Extension intl [英] macOS Sierra installing PHP Extension intl

查看:229
本文介绍了macOS Sierra安装PHP Extension intl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使magento 2.x在我的计算机上运行.我正在使用具有相同php版本的xampp 5.6并正在运行虚拟apache服务器.

I am trying to get magento 2.x to run on my machine. I am using xampp 5.6 with the same php version and running a virtual apache server.

如该屏幕快照所示 PHP扩展国际化.丢失了.

As seen in this screenshot The PHP Extension intl. is missing.

我正在研究如何添加/激活它.

I was researching on how it can be added / activated.

我尝试取消注释xampp的php.ini中的扩展名,但是它仍然显示为丢失.

I tried uncommenting the extension in the php.ini of xampp but it still appears as missing.

我尝试遵循此指南,但是当我尝试使用

I tried to follow this guide, but when I try to install intl with

sudo pecl install intl

它失败并显示

2 warnings and 1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed

推荐答案

您必须提供XAMPP随附的intl.so文件.

You have to provide the intl.so file which doesn't come with XAMPP.

要解决此问题,您只需按照以下步骤操作即可.

To fix this you just have to follow the steps below.

  1. 获取intl.so文件(如下所述)
  2. 将intl.so文件复制到/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts- [some date]/
  3. 在您的php.ini文件的末尾添加一个新行extension=intl.so,该文件通常位于/Applications/XAMPP/xamppfiles/etc/php.ini
  4. 重新启动Apache Server
  1. Get the intl.so file (explained below)
  2. Copy the intl.so file to /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-[some date]/
  3. Add a new line extension=intl.so to the end of your php.ini which is usually located at /Applications/XAMPP/xamppfiles/etc/php.ini
  4. Restart Apache Server

只有第一步对于不同的用户有所不同.

Only the first step is different for different users.

您必须获取正确的intl.so文件.

You have to get the correct intl.so file.

如果您具有php 7.0,请运行brew install php70-intl 其他版本必须为php71-intlphp56-intl.

if you have php 7.0 run brew install php70-intl other versions must be php71-intl or php56-intl.

您的国际机场可以在/usr/local/Cellar/php70-intl/[version]/intl.so

对于不同的php版本,应该类似.

It should be similar for different php versions.

要复制它:打开您的终端机

To copy it : open your terminal

cd /usr/local/Cellar/php70-intl/[version]/
cp intl.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-[some date]/

现在将您的条目添加到php ini文件中,然后重新启动Apache.

Now add your entry to the php ini file and restart Apache.

这篇关于macOS Sierra安装PHP Extension intl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆