0

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!

Rosana
  • 1
  • 1
  • 1
  • Please provide enough code so others can better understand or reproduce the problem. – Community Nov 10 '22 at 14:47
  • Remove the _lord_ theme from the Wordpress project and then it should work again. That theme looks horribly misconfigured anyway, so you're perhaps putting your server at risk if you leave it on the system (so it not only breaks Worpdress). Just kill it with fire. – hakre Nov 11 '22 at 21:07

3 Answers3

0

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:

Aldo
  • 730
  • 8
  • 20
0

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

Paul Bradbury
  • 482
  • 6
  • 8
0

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.

  • 1
    Welcome to SO! Please show how that looks like wich code in your answer and please reference offical documentation material by linking it for the configuration directives and the commands as you wrote you did so it becomes more clear for other persons what you had in mind when writing the answer. – hakre Mar 24 '23 at 16:46