php intl扩展缺失

问题描述 投票:0回答:2

我正在使用Mac Mojave。安装MAMP。作曲家版1.8.4。尝试使用时在htdocs中创建cakePHP项目

composer create-project --prefer-dist cakephp/app test

终端出错了

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/intl.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/intl.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20160303/intl.so in Unknown on line 0
Installing cakephp/app (3.7.1)
  - Installing cakephp/app (3.7.1): Loading from cache
Created project in patientcare
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - cakephp/cakephp 3.7.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.7.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.7.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.7.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.7.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.7.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - Installation request for cakephp/cakephp 3.7.* -> satisfiable by cakephp/cakephp[3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

在互联网上做一些研究,我试图在intl extension的php文件中启用etc/php.ini,并在MAMP文件夹中启用php.ini文件。

我被困在这一整天,但未能取得任何进展。

请帮我。

php macos cakephp frameworks
2个回答
1
投票

您的问题不是没有启用扩展(它是IS)。

你的问题是这样的:

dlopen():找不到文件:/usr/lib/php/extensions/no-debug-non-zts-20160303/intl.so

此路径和/或文件不存在。检查ini中的“extension_dir”文件夹设置。找到正确的文件夹并相应地调整“extension_dir”文件夹设置。


0
投票

问题是通常xammp / mamp / etc往往有不同的php.ini文件用于命令行和web,所以最好的办法是找出命令行使用哪一个,在命令行中运行php -i

找到正确的文件后,在那里启用它。您可以检查扩展名是否加载了php -m

© www.soinside.com 2019 - 2024. All rights reserved.