20

When running the following commands:

php bin/magento cache:flush
php bin/magento set:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

I get this error:

An exception was raised while creating "Request"; no instance returned
4
  • did you check the permission for generated and the var-folders? Jan 8 '19 at 10:59
  • 1
    it's caused by vesrion of php 7.3 i just delete this version and installed the appropriate extensions for 7.1 Jan 8 '19 at 11:00
  • I need help in other subject : I have to delete some products and add others in the grid of products and i want to show specific products of category. So i need to override the grid in BO but when it comes to di. I don't know what to put as main table because i have different type of products (configurable virtual and simple] and every type had its tables. Jan 8 '19 at 11:07
  • Thanks for the answer I try with this on my php7.2 magento2 '2.3.1, sudo update-alternatives --set php /usr/bin/php7.2 Sucess. May 9 '19 at 6:46
49

Please change the PHP version of your terminal using

sudo update-alternatives --set php /usr/bin/php7.2

Change PHP version according to your Magento version. E.g. for Up to Magento 2.3.2 PHP 7.2 is highest version

32

Most of the time downgrading PHP is not feasible. So until we get fix from Magento here is a work around

As of PHP 7.3, a warning will be thrown when continue is used within a switch without a numeric argument. Ref: php/php-src@04e3523

So changing core files solve the issue.

  1. Change continue to continue 2 in vendor/zendframework/zend-stdlib/src/ArrayObject.php @ line 426.
  2. Change continue to continue 2 in vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php @ line 901.
  3. Change continue to continue 2 in vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php @ line 920.
  4. Change continue to continue 2 in vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php @ line 932.

Now try doing bin/magento setup:upgrade. It will work ..!!

2
2

This issue happens due to PHP changes and now need to use "continue 2" withing "switch" case.

You need to changes the vendor\zendframework\zend-stdlib\src\ArrayObject.php at line #426

continue

TO

continue 2

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