skip to Main Content

This is my first question. I’m a beginner. I’m working in a wordpress project with sage. When I try to run the template, there is a mistake:

enter image description here

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

I’ve tried to change the php version in lando.yml and then using the command lando rebuild but it doesn’t work. I’m also working with manjaro. Any help will be welcome. Thanks!

3

Answers


  1. You could start with 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 get a .lando.yml where you need to specify the php version for the appserver.

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

    You also might need to destroy and rebuild after making that php-change:

    lando destroy -y && lando start 
    

    Sources:

    Login or Signup to reply.
  2. To use particular PHP version you can add in config – except using in

    services:
      myservice:
        
    

    Example WordPress lando.yml

    name: testwordpress
    recipe: wordpress
    config:
      webroot: .  
      php: 8.1
    

    For details on particular PHP version you can check lando official guide

    Login or Signup to reply.
  3. For pantheon recipes:

    I hope this saves someone as confused as I was some time. I changed my .lando file to 8.1 and rebuilt, then tried destroy & start. Both failed.

    It turned out I had to go to pantheon.yml and change php version there also. I suppose that’s a ‘dependency’ which holds lando back.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search