search

Home  >  Q&A  >  body text

How to change php version in Lando 8.1.2

This is my first question. I am a beginner. I'm working on a WordPress project with Sage. When I try to run the template I get the error:

The composer version is okay, but the Lando version is php7.4, and I need the php8.1 version.

I tried changing the php version in lando.yml and then using the command lando rebuild but it didn't work. I'm also working with manjaro. Any help is welcome. Thanks!

P粉714844743P粉714844743407 days ago795

reply all(1)I'll reply

  • P粉145543872

    P粉1455438722023-11-03 18:01:19

    You can start from lando init

    $ lando init
    ? From where should we get your app's codebase? remote git repo or archive
    ? Please enter the URL of the git repo or tar archive containing your application code https://wordpress.org/latest.tar.gz
    ? What recipe do you want to use? wordpress
    ? Where is your webroot relative to the init destination? wordpress
    ? What do you want to call this app? my-wordpress-app
    

    Then you will get a .lando.yml, where you need to specify the php version of appserver.

    # .lando.yml
    name: my-wordpress-app
    recipe: wordpress
    config:
      webroot: wordpress
    services:
      appserver:
        type: php:8.1 #add these lines
    

    You may also need to destroy and rebuild after making php changes:

    lando destroy -y && lando start 
    

    source:

    reply
    0
  • Cancelreply