【发布时间】:2019-03-21 07:15:58
【问题描述】:
我使用的是 Mac Mojave。已安装MAMP。作曲家版本1.8.4。尝试使用
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