doubangzhang6992 2019-01-15 20:22
浏览 263

如何在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:

  1. Made a copy of php.ini using cp /etc/php.ini.default php.ini
  2. Removed ";" before extension=php_intl.dll
  3. 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?

  • 写回答

3条回答 默认 最新

  • duanji1056 2019-01-25 16:14
    关注

    Here's a solution that worked for me:

    1. Find all PHP versions installed brew list | grep php
    2. Remove all versions of PHP brew remove --ignore-dependencies --force php70 php71 php72 (based on what you see above)
    3. Install PHP brew install php72 (i chose 7.2, 7.3 is not supported yet by several vendors)
    4. Run the command which php should show you the path to the installed PHP. Copy the path.
    5. Update your bash_profile vi ~/.bash_profile and add this line to the file: export PATH=/usr/local/php5/bin:$PATH
    6. Save and run this source ~/.bash_profile
    7. 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.

    评论

报告相同问题?

悬赏问题

  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频