cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR: "Could not open input file: bin/magento

SOLVED

ERROR: "Could not open input file: bin/magento

when i run the php bin/magento cron:run, i get this error

magento cmd error.PNG

"Could not open input file: bin/magento.

 

Please help

1 ACCEPTED SOLUTION

Accepted Solutions

Re: ERROR: "Could not open input file: bin/magento

Hi @michael_oluwaseyi

 

Well it looks like you are not running command from magento 2 root directory !

 

Right now you are running command from main directory of server , not magento 2 root directory !

 

That's the reason its showing bin/magento not found.

 

So change your directory using CD command and go to magento 2 root directory !

 

Then try the command - it will works !

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

View solution in original post

6 REPLIES 6

Re: ERROR: "Could not open input file: bin/magento

Hi @michael_oluwaseyi

 

Not sure what have you done after adding some new code but i guess this is the issue cause your new code is not compiled.

 

Below is the  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 generated
  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.

if issue solved,Click Kudos & Accept as Solution

Re: ERROR: "Could not open input file: bin/magento

Hello @michael_oluwaseyi

 

A possible problem like some of the lib files missing

 

please check error file into bin folder, it should created there, if not found then check into root folder of magento

 

 

hope it will help you.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: ERROR: "Could not open input file: bin/magento

Hi @Manthan Dave thanks for replying to my issue.

 

When i tried to run the Sudo command, i get an error

Capture.PNG

"u0529260 is not in the sudoers file. This incident will be reported.".

 

What could be wrong.

Re: ERROR: "Could not open input file: bin/magento

Hi @michael_oluwaseyi

 

Well it looks like you are not running command from magento 2 root directory !

 

Right now you are running command from main directory of server , not magento 2 root directory !

 

That's the reason its showing bin/magento not found.

 

So change your directory using CD command and go to magento 2 root directory !

 

Then try the command - it will works !

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: ERROR: "Could not open input file: bin/magento

thanks @Manthan Dave the reason is because i was not referring to the right PHP version in my SSH. i was supposed to use /opt/php/7.0/bin/php, instead of /php which is the wrong syntax

 

Thanks for your contribution.

Re: ERROR: "Could not open input file: bin/magento

Glad to know that you have resolved your issue .

Happy to help and keep helping Smiley Happy
if issue solved,Click Kudos & Accept as Solution