When i want to re Index in Magento2 in php version of 7.3,
this display me this error
An exception was raised while creating "Request"; no instance returned
And when i change to version 7.2
Display this Error…..
Also i use this command with my root Directory (same error)
So how can i simply use Indexer command in Magento2
I thing something too wrong with my Magento 🙁
Also check this image :–
My all commands are not working.
Also i change my Magento Folder Permissions
Best Answer
Please mention your Magento Version first.
Your First error is coming due to most likely not changing php version properly, you should only use PHP version 7.2 when you're working on Magento 2.3.x
https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html
Try below commands for changing PHP version
Also refer this link for similar issue
Magento 2.2 with PHP 7.1.9 Issue
Try to give permission first to your Magento Directory
then use your upgrade-deploy commands.
if that doesn't help try to find solution in below link.
https://community.magento.com/t5/Magento-2-x-Admin-Configuration/CLI-not-recognizing-magento-commands/td-p/45869