wp-cli not working on 6.3.5?
-
@martinkbs you have to use the command like in https://docs.cloudron.io/apps/wordpress-developer/#wp-cli . So,
sudo -E -u www-data php /app/pkg/wp --path=/app/data/public/ plugin list
To explain the arguments:
sudo
is for running the command as a different user.-u www-data
means run it as www-data user (which is what apache is running as)- -E means to preserve environment variables. This way the container's env vars are passed on to the CLI command as well.
- --path is required to specify the path to the installation of WP.
-
Hi @girish
WP-cli commands, up to version 6.3.X update have always worked the same way. In fact, I have several Cloudrons in version 6.2.8, in which the 'wp plugin list' command works as WP-cli has to.
According to your explanation, it means that from now on, in version 6.3.X you have to put the command as you mentioned?
sudo -E -u www-data php /app/pkg/wp --path=/app/data/public/ plugin list
Or is it going to restore the original format that was used until now? As you will see, it is not a very productive way to work with the terminal.
-
I had made a change that source any app specific rcfile for 6.3. I did this for https://forum.cloudron.io/topic/4992/seting-bash-aliases-for-cloudron-terminal. Unfortunately, this breaks sourcing of the personal rcfile. From the man page,
--rcfile file Execute commands from file instead of the system wide initialization file /etc/bash.bashrc and the standard personal initialization file ~/.bashrc if the shell is interac‐ tive (see INVOCATION below).
@martinkbs I will look into how to fix this now that I know what the issue is. Thanks for reporting! For the moment, the workaround is to type
source /root/.bashrc
after you open a web terminal and then the wp command should work. -
Thanks @girish
Checked. After starting the terminal, inserting the command
source /root/.bashrc
, WP-cli works normally.Connecting... If you resize the browser window, press Ctrl+D to start a new session with the current size. root@2d2d8096-2889-44f0-b36b-0aed411943c6:/app/code# source /root/.bashrc root@2d2d8096-2889-44f0-b36b-0aed411943c6:/app/code# wp core version 5.8 root@2d2d8096-2889-44f0-b36b-0aed411943c6:/app/code#
At least, even temporarily, it solves the problem and lets you use the terminal.
If you need help, please let me know to make checks.
Thanks again!