【问题标题】:php intl extension missingphp intl 扩展丢失
【发布时间】:2019-03-21 07:15:58
【问题描述】:

我使用的是 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.

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

我在这个问题上卡了一整天,没有取得任何进展。

请帮助我。

【问题讨论】:

  • 您尝试过的方法是什么 - 现在是否已安装?如果不是,那么你编辑了错误的 php.ini。
  • @LarsStegelitz 编辑了/etc/php.ini 并添加了extension=intl.so,然后编辑了/Applications/MAMP/conf/php7.2.10/php.ini 并添加了extension=intl.so。我仍然遇到同样的错误。
  • 使用 phpinfo 找出 LOADED ini 文件的位置。例如。编写一个只有“phpinfo()”的php脚本,然后通过浏览器调用它
  • @LarsStegelitz 如前所述--Loaded Configuration File /Applications/MAMP/bin/php/php7.2.10/conf/php.ini。在该配置文件中还启用了extension=intl.so
  • intl Internationalization support enabled version 1.1.0 ICU version 56.1 ICU Data version 56.1 ICU TZData version 2015f ICU Unicode version 8.0

标签: php macos cakephp frameworks


【解决方案1】:

您的问题不在于未启用扩展程序(它是)。

你的问题是这样的:

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

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

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

    • php -i -> Configuration File (php.ini) Path => /etcextension=intl.so 已启用。 php -m -> intl 未列在 PHP 模块列表中。
    猜你喜欢
    • 2017-05-19
    • 2018-05-10
    • 2016-07-31
    • 2020-04-11
    • 2012-11-16
    • 2016-01-21
    • 1970-01-01
    • 1970-01-01
    • 2018-11-14
    相关资源
    最近更新 更多