1

I'm trying to upgrade magento 2 version to the latest version by following commands

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.3.5 --no-update
composer update
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/generation/*
php bin/magento setup:upgrade

Above commands executed successfully. When run php bin/magento setup:di:compile getting below error in command line -

An exception was raised while creating "Application"; no instance returned#0 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'application', 'Application')
#1 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('application', 'Application')
#2 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Application', 'application')
#3 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#4 /public_html/vendor/zendframework/zend-mvc/src/Application.php(261): Zend\ServiceManager\ServiceManager->get('Application')
#5 /public_html/vendor/magento/framework/Console/Cli.php(57): Zend\Mvc\Application::init(Array)
#6 /public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#7 {main}

An exception was raised while creating "Request"; no instance returned#0 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'request', 'Request')
#1 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('request', 'Request')
#2 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Request', 'request')
#3 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#4 /public_html/vendor/zendframework/zend-mvc/src/Application.php(113): Zend\ServiceManager\ServiceManager->get('Request')
#5 /public_html/vendor/zendframework/zend-mvc/src/Service/ApplicationFactory.php(29): Zend\Mvc\Application->__construct(Array, Object(Zend\ServiceManager\ServiceManager))
#6 [internal function]: Zend\Mvc\Service\ApplicationFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'application', 'Application')
#7 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(939): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'application', 'Application')
#8 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'application', 'Application')
#9 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('application', 'Application')
#10 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Application', 'application')
#11 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#12 /public_html/vendor/zendframework/zend-mvc/src/Application.php(261): Zend\ServiceManager\ServiceManager->get('Application')
#13 /public_html/vendor/magento/framework/Console/Cli.php(57): Zend\Mvc\Application::init(Array)
#14 /public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#15 {main}

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /public_html/vendor/zendframework/zend-stdlib/src/ArrayObject.php on line 426#0 /public_html/vendor/composer/ClassLoader.php(444): Magento\Framework\App\ErrorHandler->handler(2, '"continue" targ...', '/home/rewardpor...', 426, Array)
#1 /public_html/vendor/composer/ClassLoader.php(444): include()
#2 /public_html/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/rewardpor...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Zend\\Stdlib\\Arr...')
#4 /public_html/vendor/zendframework/zend-stdlib/src/Parameters.php(29): spl_autoload_call('Zend\\Stdlib\\Arr...')
#5 /public_html/vendor/zendframework/zend-console/src/Request.php(96): Zend\Stdlib\Parameters->__construct()
#6 /public_html/vendor/zendframework/zend-console/src/Request.php(122): Zend\Console\Request->getParams()
#7 /public_html/vendor/zendframework/zend-console/src/Request.php(66): Zend\Console\Request->params()
#8 /public_html/vendor/zendframework/zend-mvc/src/Service/RequestFactory.php(29): Zend\Console\Request->__construct()
#9 [internal function]: Zend\Mvc\Service\RequestFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'request', 'Request')
#10 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(939): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'request', 'Request')
#11 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'request', 'Request')
#12 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('request', 'Request')
#13 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Request', 'request')
#14 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#15 /public_html/vendor/zendframework/zend-mvc/src/Application.php(113): Zend\ServiceManager\ServiceManager->get('Request')
#16 /public_html/vendor/zendframework/zend-mvc/src/Service/ApplicationFactory.php(29): Zend\Mvc\Application->__construct(Array, Object(Zend\ServiceManager\ServiceManager))
#17 [internal function]: Zend\Mvc\Service\ApplicationFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'application', 'Application')
#18 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(939): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'application', 'Application')
#19 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'application', 'Application')
#20 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('application', 'Application')
#21 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Application', 'application')
#22 /public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#23 /public_html/vendor/zendframework/zend-mvc/src/Application.php(261): Zend\ServiceManager\ServiceManager->get('Application')
#24 /public_html/vendor/magento/framework/Console/Cli.php(57): Zend\Mvc\Application::init(Array)
#25 /public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#26 {main}

I have PHP 7.1 version.

Am I missing any other command to run before compile?

Or what should I do to compile successfully?

0

MAgento 2.3. works on php 7.2 or Higher

please Update You PHP version and Also

Use

php bin/magento setup:static-content:deploy -f 

Instead Of

php bin/magento setup:static-content:deploy 
| improve this answer | |
  • I tried with 7.2 and with 7.3 but then php bin/magento cache:clean command also throwing same error. Even cache:clean command working with php 7.1. And still other commands throwing same error with 7.2 and 7.3 – Vinaya Maheshwari Jun 16 at 12:54
  • do you have installed are the required PHP Modules in 7.2? – User 69 Jun 16 at 12:55
  • No, which modules? Can you please list here? – Vinaya Maheshwari Jun 16 at 12:56
  • See Verify installed extensions Section – User 69 Jun 16 at 12:57
0

You need to upgrade the PHP version

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.