I am trying to run commands through ssh, but commands are not working. Please check the screenshot.

Enter image description here

up vote 6 down vote accepted

This means the php not set as a Environment Variable.

So it must be tried with a full path with php:



  • no such file or directory found ... prntscr.com/ky5ct1 – samair ali Sep 24 at 15:43
  • @samairali it is example not the correct path you have to find yours. – PROGOSTECH Sep 24 at 15:46
  • 1
    What do you mean by "global variable"? Isn't this about search paths? – Peter Mortensen Sep 24 at 18:27
  • @PeterMortensen my mistake it is a Environment variable. added the reference. – PROGOSTECH Sep 25 at 15:03

Run this in SSH:

which php

And then provide the full path e.g.:

/usr/bin/php bin/magento

Replace the /usr/bin/php with the result of which php command

  • This won't help. which just searches the path ... if php can be found on the path, then running it without the full path would work just fine. – Matthew Read Sep 24 at 22:27
  • I had a same problem, and specifying the full path to the php worked. Like in the answer by @PROGOSTECH setting a php global variable solved the problem permanently. – Bare Feet Sep 25 at 8:11

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.