简体   繁体   English

PHP国际扩展名丢失

[英]php intl extension missing

I'm using a Mac Mojave. 我正在使用Mac Mojave。 Installed MAMP . 安装了MAMP Composer Version 1.8.4 . 作曲者版本1.8.4 When trying to create cakePHP project inside the htdocs by using 当尝试通过使用在htdocs中创建cakePHP项目时

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

The terminal is giving error 终端出现错误

    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.

Doing some research on the internet, I tried to enable the intl extension in the php files in etc/php.ini and also the php.ini file inside the MAMP folder. 在Internet上进行了一些研究,我试图在etc/php.ini中的php文件中以及MAMP文件夹中的php.ini文件中启用intl extension

I am stuck on this for a whole day and had not been able to make any progress. 我整整一天都被困在这里,无法取得任何进展。

Please help me. 请帮我。

Your problem is NOT that the extension is not enabled (it IS). 您的问题不是扩展未启用(它是)。

Your problem is this: 您的问题是这样的:

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

This path and/or file just does not exist. 该路径和/或文件不存在。 Check the ini for the "extension_dir" folder setting. 检查ini中的“ extension_dir”文件夹设置。 Locate the proper folder and adjust the "extension_dir" folder setting accordingly. 找到正确的文件夹,并相应地调整“ extension_dir”文件夹设置。

The issue is that generally xammp / mamp / etc tend to have different php.ini files for command line and web, so the best idea is to find figure out which one is being used by command line, running php -i in your command line. 问题是通常xammp / mamp / etc倾向于在命令行和Web上使用不同的php.ini文件,因此最好的办法是找出命令行使用的是哪个文件,并在命令行中运行php -i

Once you figured out the right file, enable it there. 找到正确的文件后,在此处启用它。 You can check if the extension is loaded with php -m . 您可以检查扩展名是否已加载php -m

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM