magento设置:升级PHP致命错误:未捕获的错误:未找到类'IntlDateFormatter'

问题描述 投票:-1回答:1

我在Mac上的Mamp中安装了magento 2.3.5-p1。现在我想添加一个模块,但是我得到了命令

bin/magento setup:upgrade

错误代码

Running schema recurring...PHP Fatal error:  Uncaught Error: Class 'IntlDateFormatter' not found in /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Stack trace: 
#0 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) 
#1 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') 
#2 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') 
#3 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'localeDate', 'Magento\\Framewo...') 
#4 /Users/ingokrah/Sites/aquamed in /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
{"messages":{"error":[{"code":500,"message":"Server internal error. See details in report api\/365677830219"}]}}%

扩展名php-intl已安装并激活,因为bash中的查询成功完成

▶ php -i | grep intl

Configure Command =>  './configure'  '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-zlib-dir=/Applications/MAMP/Library' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php7.3.9' '--exec-prefix=/Applications/MAMP/bin/php/php7.3.9' '--sysconfdir=/Applications/MAMP/bin/php/php7.3.9/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php7.3.9/conf' '--enable-ftp' '--with-bz2=/Applications/MAMP/Library' '--with-mysqli=mysqlnd' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--with-imap-ssl=/Applications/MAMP/Library' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-openssl=/Applications/MAMP/Library' '--enable-zip' '--with-pcre-dir=/Applications/MAMP/Library' '--with-libzip=/Applications/MAMP/Library' '--with-iconv=/Applications/MAMP/Library' '--enable-opcache' '--enable-intl' '--with-tidy=shared' '--with-icu-dir=/Applications/MAMP/Library' '--enable-wddx' '--with-libexpat-dir=/Applications/MAMP/Library' '--with-readline' '--with-mhash' '--with-iconv-dir=/Applications/MAMP/Library' '--with-sodium=/Applications/MAMP/Library' '--with-password-argon2=/Applications/MAMP/Library' '--enable-cgi' '--disable-phpdbg' 'YACC=/Applications/MAMP/Library/bin/bison'
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0

phpinfo还确认php-intl是活动的。

错误的根源是什么?

teccrow

php magento2 mamp intl
1个回答
0
投票

如果尚未切换到开发人员模式。

bin/magento deploy:mode:set developer

清除缓存并清除生成的/文件夹。

bin/magento cache:flush
rm -rf generated/*

然后运行bin/magento setup:upgrade

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