How to change php version in Lando 8.1.2
P粉714844743
P粉714844743 2023-11-02 22:35:17
0
1
796

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粉714844743
P粉714844743

reply all(1)
P粉145543872

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:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template