5

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.com 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

2
  • 1
    Can you access wp directly? php /path/to/wp-cli.phar @staging --info 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

2 Answers 2

3

Found a solution here https://github.com/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
0

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.

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.