So ändern Sie die PHP-Version in Lando 8.1.2
P粉714844743
P粉714844743 2023-11-02 22:35:17
0
1
727

Das ist meine erste Frage. Ich bin ein Anfänger. Ich arbeite an einem WordPress-Projekt mit Sage. Wenn ich versuche, die Vorlage auszuführen, erhalte ich die Fehlermeldung:

Die Composer-Version ist in Ordnung, aber die Lando-Version ist PHP7.4 und ich benötige die PHP8.1-Version.

Ich habe versucht, die PHP-Version in lando.yml zu ändern und dann den Befehl lando rebuild zu verwenden, aber es hat nicht funktioniert. Ich arbeite auch mit Manjaro. Jede Hilfe ist willkommen. Danke!

P粉714844743
P粉714844743

Antworte allen(1)
P粉145543872

您可以从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

然后你会得到一个.lando.yml,你需要在其中指定appserver的php版本。

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

您可能还需要在进行 php 更改后销毁并重建:

lando destroy -y && lando start 

来源:

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!