- When use command line in magento 2, in file bin/magento with some code ex: setup, cache, indexer,…
- Some time you can get error but nothing to debug.
- Let try command follow:
php -d display_errors bin/magento >log.txt
Example: when I run sudo php bin/magento setup:upgrade, I get an error: “There are no commands defined in the “setup” namespace.”
- So, I also get an warring: “Cannot read contents from file “/home/ubuntu/public_html/220.127.116.11/app/code/Dreamcode/Webapi/etc/module.xml” Warring: file_get_contents … : No such file or directory”
- And after then, I could find a solution to fix this problem and my command line working fine.