I installed magento 2.3.5-p1 in Mamp on my Mac. Now I wanted to add a module, but I get the command
bin/magento setup:upgrade
the error code
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): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Magento\Framewo...', Array)
#1 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryDynamicDeveloper->create('Magento\Framewo...')
#2 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): MagentoFrameworkObjectManagerObjectManager->get('Magento\Framewo...')
#3 /Users/ingokrah/Sites/aquamed/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): MagentoFrameworkObjectManagerFactoryAbstractFactory->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"}]}}%
The extension php-intl is installed and activated because the query in the bash is successful
▶ 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
The phpinfo also confirms that php-intl is active.
What can be the source of the error?
teccrow
2
Answers
The solution was now easier than expected. There was a conflict between the Mamp Apache server and the Macos Apache server.
Although the path
export PATH="/Applications/MAMP/bin/php/php7.3.9/bin:$PATH"
is available in the .bash_profile file, macos php was accessed when executingbin/ magento
and no intl module is enabled there.I restarted the terminal app and ran the
source ~/.bash_profile
. Thenbin/magento setup:upgrade
ran successfullySwitch to developer mode if you are not already.
Clear cache and clear generated/ folder.
And after that run
bin/magento setup:upgrade