Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP CLI not installed in container (/bin/sh: 1: wp: not found wp: not found) #15

Open
clacdesdoigts opened this issue May 12, 2022 · 4 comments

Comments

@clacdesdoigts
Copy link

WP CLI is not being installed in the default "appserver" service
Thus, typing lando wp returns /bin/sh: 1: wp: not found

Might be related to #3395

My lando.yml :

name: wordpress
recipe: wordpress
proxy:
  appserver:
    - wordpress.lndo.site
    - espace.wordpress.lndo.site
    - account.wordpress.lndo.site
    - ca.wordpress.lndo.site
config:
  php: "7.3"
  via: apache
  webroot: web
  database: mysql:5.7
  xdebug: true
# Services
services:
  database_admin:
    type: phpmyadmin:5.0
    hosts:
      - database
  mail:
    type: mailhog:v1.0.0
    portforward: true
    hogfrom:
      - appserver

Commands are launched in WSL2 (core version : 5.10.16) on Windows 11, in a Debian 11 (bullseye) distribution.
Lando version : 3.6.5

@rtfm-47 rtfm-47 removed the wordpress label May 12, 2022
@rtfm-47 rtfm-47 transferred this issue from lando/lando May 12, 2022
@matpratta
Copy link

@clacdesdoigts try running lando rebuild, I had this issue with another recipe and it fixed the issue

@alex-r-redfern
Copy link

I think this may be related to https://github.com/lando/wordpress/blob/main/recipes/wordpress/builder.js only installing the CLI if the PHP version is 7.4.
I'm seeing the same issue when running Lando in 8.0 and it looks like the above is using 7.3

@alex-r-redfern
Copy link

Yep, just confirmed: switching my lando yml to use 7.4 installs the cli but 8.0 does not

@alex-r-redfern
Copy link

As a stop-gap for anyone else experiencing this whilst this bug still happens, add this to your lando config:

services:
  appserver:
    build_as_root:
      - curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
      - chmod +x wp-cli.phar
      - mv wp-cli.phar /usr/local/bin/wp

and down at the bottom:

tooling:
  wp:
    service: 'appserver'

This makes lando wp work as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants