3

Yesterday I was working on my new Magento2 site and add new module after that I use SSH command and it was working perfectly but today morning I start working and start putty to run command but it's not working. if I run any command it's show me error that could not open input file : bin/magento.

First I run command php bin/magento setup:upgrade then php bin/magento setup:static-content:deploy also I run command related cache , indexing but same error I get all the time.

can anyone tell me why is it happening ? and how to solve this error message?

I checked in magento root folder that there is bin folder and within bin folder there is magento file.

  • Please check ssh user and sftp user are different ? – Amit Bera Jun 4 '16 at 6:33
  • @AmitBera that is not a issue because I was working yesterday using same username and password. – Dhaval Jun 4 '16 at 6:34
  • As per as,my concept it may permission issue for user. Try to give excute permission to` bin/magento` by find -L vendor/bin -type f -exec chmod u+x {} \; – Amit Bera Jun 4 '16 at 6:38
  • revert the module and check again because I met the same issue while made mistake in registration.php (wrong module name). – Bilal Usean Jun 4 '16 at 6:39
  • Also , Disable your module and run code – Amit Bera Jun 4 '16 at 6:54
2

I don't know what have you done after adding some new code but i guess this is the issue cause your new code is not compiled. I am writing some command you should run after adding new code.

Go to the root folder of your Magento project and run the following commands :

  1. sudo rm -rf var/cache var/generation var/di
  2. sudo php bin/magento setup:upgrade
  3. sudo php bin/magento setup:di:compile
  4. sudo php bin/magento cache:clean
  5. sudo chmod 777 -R var/

Hope it will solve your problem.

2

I too faced the same problem. But I was inside bin and typing

php bin/magento setup:upgrade

But instead of that I should type

php magento setup:upgrade

(NOTE: no bin required).

So check the path where you are in and point to bin folder magento file.

1

I was facing same issue. First of all you need to CD your magento installation direcotry. For example cd /my/magento/installation/directory and then run the command php bin/magento setup:upgrade;

  • This can also be done in the bin folder – Rebel May 5 '17 at 21:57
1

I faced this issue on windows and solved it by this command instead:

php bin\\magento setup:static-content:deploy

I doubled the \ to \\

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.