我正在尝试在macOS Mojave上安装Magento(2.3.0)。 Magento显示PHP Extension intl.
缺失。
我尝试以下解决方法:
cp /etc/php.ini.default php.ini
制作了php.ini的副本extension=php_intl.dll
之前sudo apachectl restart
但上面没有解决。
在检查php -v
时,我看到以下错误:
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
在/usr/lib/php/extensions/no-debug-non-zts-20160303
下只有2个文件,即opache.so
和xdebug.so
如何在我的macOS Mojave上安装或启用“PHP Extension intl”?
这是一个适合我的解决方案:
brew list | grep php
的所有PHP版本brew remove --ignore-dependencies --force php70 php71 php72
(基于您在上面看到的内容)brew install php72
(我选择7.2,7.3尚未被多家供应商支持)which php
应该显示已安装的PHP的路径。复制路径。vi ~/.bash_profile
并将此行添加到文件中:export PATH=/usr/local/php5/bin:$PATH
source ~/.bash_profile
php -m | grep intl
安装了PHP Intl Extension。如果安装顺利,我们将看到列出的intl。如果没有,则不安装扩展。我认为从PHP 7(不确定版本),默认情况下扩展是可用的,我们不需要在php.ini文件中明确启用它们。
如果您安装了Homebrew的php,将其链接到路径中的目录将解决问题。 brew link --force [email protected]
我有同样的问题并修复了它。 Here是我得到详细答案的链接
从链接获得帮助,并能够编译https://donatstudios.com/Install-PHP-Mcrypt-Extension-in-OS-X
接下来我们将下载PHP源代码。验证您正在运行的PHP的确切版本。这可以如下检索。该版本突出显示。
$ php --version
PHP 7.1.19 (cli) (built: Aug 17 2018 18:03:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Now we move into a working directory and download the source making sure to update the following for the version from above.
$ cd /tmp
$ curl -L http://php.net/get/php-{{php-version}}.tar.bz2/from/this/mirror > php.tar.bz2
$ open php.tar.bz2
Now we will compile and test the extension.
$ cd php-{{php-version}}/ext/{{extension}}
$ phpize
$ ./configure
$ make
$ make test
$ sudo make install
If all that goes well finally we'll need to add the following to our php.ini - I usually add at it at the end of the file.
extension = {{extension}}
.so
You can verify your installation with the following:
$ php --info | grep {{extension}}\\.
Lastly, depending on your setup now you may want to restart apache.
$ sudo apachectl restart