intl扩展 mac 安装php,如何在macOS Mojave上启用PHP Intl扩展?

I'm trying to install Magento (2.3.0) on macOS Mojave. Magento shows PHP Extension intl. is missing.

I tried the below to resolve:

Made a copy of php.ini using cp /etc/php.ini.default php.ini

Removed ";" before extension=php_intl.dll

Restart Apache sudo apachectl restart

But the above did not resolve.

On checking php -v, i'm seeing the below error:

PHP Warning: PHP Startup: Unable to load dynamic library

'/usr/lib/php/extensions/no-debug-non-zts-20160303/php_intl.dll' -

dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/php_intl.dll,

0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-

non-zts-20160303/php_intl.dll in Unknown on line 0

PHP 7.1.19 (cli) (built: Aug 17 2018 20:10:18) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

There are only 2 files under /usr/lib/php/extensions/no-debug-non-zts-20160303 namely opache.so and xdebug.so

How can i install or enable "PHP Extension intl" on my macOS Mojave?

解决方案

Here's a solution that worked for me:

Find all PHP versions installed brew list | grep php

Remove all versions of PHP brew remove --ignore-dependencies --force php70 php71 php72 (based on what you see above)

Install PHP brew install php72 (i chose 7.2, 7.3 is not supported yet by several vendors)

Run the command which php should show you the path to the installed PHP. Copy the path.

Update your bash_profile vi ~/.bash_profile and add this line to the file:

export PATH=/usr/local/php5/bin:$PATH

Save and run this source ~/.bash_profile

Check if PHP Intl Extension is installed using php -m | grep intl. If the installation went well, we will see intl listed. If not the extension is not installed.

I think from PHP 7 (not sure of the version), the extensions are available by default and we need not enable them in php.ini file explicitly.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值