cancel
Showing results for 
Search instead for 
Did you mean: 

SSH not accepting any command starting with php text

SSH not accepting any command starting with php text

Hi Team

I installed magento 2.3.5 with php 7.2

I am unable to execute any command in starting with PHP in SSH getting below mentioned message.

bash: /opt/php/php-5.5.0/bin/php: No such file or directory

In all command starting with PHP giving same message.

Please help

3 REPLIES 3

Re: SSH not accepting any command starting with php text

@vasu _sachan 

 

Find the php path for 7.2 version and then run using that path command:

 

ie.:

<php 7.2 path> bin/magento cache:flush

Manish Mittal
https://www.manishmittal.com/

Re: SSH not accepting any command starting with php text

@vasu _sachan if you want to run the commands using the php keyword then just set the default cli version to php7.2 using the below command.

 

sudo update-alternatives --set php path-to-php7.2

for example

sudo update-alternatives --set php /usr/bin/php7.2

After that just run the commands using php bin/magento cache:flush


Thanks

Re: SSH not accepting any command starting with php text

2
 

First, do not use PuTTY. PuTTY is a GUI application intended for an interactive use. Use Plink, which is command-line/console equivalent of PuTTY intended for command automation. Being a console application, it has a standard output, which can be read in PHP (PuTTY as a GUI application does not have standard output).

With Plink, you can also specify the command on Plink command line, so you do not need to create the test.txt command file. Bluestacks Omegle

In any case, there's no way to make PuTTY or Plink separate an output of command only (at least not from a command-line).

But what you can do, is to print some header/trailer to distinguish the start and end of the command output, like:

plink.exe -ssh pi@RasPiIP -pw raspberry "echo start-of-command && command && echo end-of-command"

And then in PHP, you can look for the start-of-command and end-of-command to identify what part of Plink output is really the command output