How to fix the «Permission denied» failure on a «bin/magento» command

To fix the issue you should add the «execute» permissions for the bin/magento file using the chmod command:

chmod u+x bin/magento
1 Like

Great help. I used a softaculous script to install magento 2 and I was getting the permissions problem. This sorted it. Thanks for your help.

You can also try to use php bin/magento instead of bin/magento, but the solution from the topmost post is the best.