admin管理员组

文章数量:1332353

I'm stuck trying to do the remote SSH with WP-CLI.

I have installed WP-CLI on my Webfaction server and tested it's working

# This is in server

$ wp --info

OS:     Linux web561.webfaction 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Shell:  /bin/bash
PHP binary:     /usr/local/bin/php56
PHP version:    5.6.40
php.ini used:   /usr/local/lib/php56/php.ini

But whenever I tried to do remote access (I'm on Windows10 using GitBash), I get this error:

# This is in my local comp

$ wp @staging --info

[email protected]'s password:
bash: wp: command not found

I'm sure there's nothing wrong with the @staging alias.

Path is definitely correct too because when I change it to non-existent directory, it gives No such file or directory error.

Have anyone experienced this problem before?

Thanks

I'm stuck trying to do the remote SSH with WP-CLI.

I have installed WP-CLI on my Webfaction server and tested it's working

# This is in server

$ wp --info

OS:     Linux web561.webfaction 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Shell:  /bin/bash
PHP binary:     /usr/local/bin/php56
PHP version:    5.6.40
php.ini used:   /usr/local/lib/php56/php.ini

But whenever I tried to do remote access (I'm on Windows10 using GitBash), I get this error:

# This is in my local comp

$ wp @staging --info

[email protected]'s password:
bash: wp: command not found

I'm sure there's nothing wrong with the @staging alias.

Path is definitely correct too because when I change it to non-existent directory, it gives No such file or directory error.

Have anyone experienced this problem before?

Thanks

Share Improve this question asked Jun 13, 2019 at 15:56 hrsetyonohrsetyono 5792 gold badges5 silver badges17 bronze badges 2
  • 1 Can you access wp directly? php /path/to/wp-cli.phar @staging --info – MikeNGarrett Commented Jun 13, 2019 at 16:03
  • Thanks for the reply. Yes, I already set the PATH and can call wp within bash. – hrsetyono Commented Jun 13, 2019 at 16:05
Add a comment  | 

2 Answers 2

Reset to default 3

Found a solution here https://github/hrsetyono/wordpress/wiki/WP-CLI-on-Webfaction .

This seems to be Webfaction specific issue

You simply need to open FTP and append this line in /home/yourname/.bashrc

export PATH=$PATH:$HOME/bin

I know this might be trivial, - but it was my solution. I simply hadn't installed WP-CLI on my machine. So I followed the install instructions here: wp-cli - and then it worked for me.

本文标签: wp cliWPCLI over SSHwp command not found