2

I have successfully installed wp-cli on my remote server and created the "wp" alias. I use Putty to connect via SSH, and everything works just fine. First, I used a .user_bashrc file to set the alias with:

alias wp='/www/htdocs/w019d58a/wp-cli.phar'

The path is set in .user_bashrc using:

export PATH=/www/htdocs/w019d58a/:$PATH

However, when I tried to run wp-cli from a bash script, I got a "wp command not found" error. I contacted the support, and they recommended a symlink. So, I created a symlink using:

ln -s /www/htdocs/w019d58a/wp-cli.phar wp

Everything works but the installation process. I can, for example, install a plugin using:

#!/bin/bash
wp plugin install akismet

Unfortunately, I can't download WordPress via the bash script using:

wp core download --locale=de_DE_formal

I always get the error:

Error: Too many positional arguments:
Error: This does not seem to be a WordPress installation.
Pass --path=path/to/wordpress or run wp core download.

I tried to add the path using:

wp core download --locale=de_DE_formal --path="/www/htdocs/w019d58a"

No luck. I stil get the same error.

I can download and install WordPress directly from the console and do further operations using a script. But I can't download and install it from the script due to the path error.

Any ideas how to fix that?

I've just found out, that the download is working fine:

#!/bin/bash
wp core download --locale=de_DE_formal

It's the config create part that causes trouble:

wp config create --dbname=d123456 --dbuser=d123456 --dbpass=123456 --dbhost=localhost --dbprefix=wplcli_
user2516117
  • 129
  • 2
  • 4
  • 13

0 Answers0