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

Enter image description here


2 Answers 2


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
    – Flutterer
    Sep 24, 2018 at 15:43
  • @samairali it is example not the correct path you have to find yours.
    Sep 24, 2018 at 15:46
  • 1
    What do you mean by "global variable"? Isn't this about search paths? Sep 24, 2018 at 18:27
  • @PeterMortensen my mistake it is a Environment variable. added the reference.
    Sep 25, 2018 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. Sep 24, 2018 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.
    – Greg
    Sep 25, 2018 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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