|
I have a site that is currently at PHP 7 and are migrating to PHP 8. I can assign a different PHP version at runtime in the sites dashboard, but running
|
Replies: 1 comment 1 reply
|
the command you're missing is lerd isolate. run lerd isolate 8.4 from inside the project and it'll write .php-version, update .lerd.yaml, update the site registry, and rebuild the FPM container and vhost, which is the same path the dashboard dropdown uses. editing .lerd.yaml and .php-version by hand won't work once a site is linked. the CLI reads the version straight from the site registry at that point and those two files only get consulted for directories that aren't linked yet, so your edits were being ignored. that's deliberate, it stops composer running on a different PHP than the container actually serving the site, but it does make hand editing look broken, which is fair enough. lerd install doesn't touch version state at all, and link refused because the site is already linked. the worktree part in your title is a separate thing and it's a real bug on our side, now tracked in #988. where does the worktree checkout live relative to the site directory? if it's nested inside the site, say the site is at ~/Code/app and the worktree is at ~/Code/app/wt/feature, then that's what you're hitting. the CLI resolves anything under a registered site path back to the parent site and picks up the parent's PHP version, even though the worktree has its own pin and its own vhost on the new version. so the browser serves the worktree on 8.4 while composer in that same directory runs 7.x. creating the worktree as a sibling directory instead, somewhere outside the site path, resolves correctly and is a decent workaround in the meantime. let us know which layout you've got, if isolate sorts you out and the worktree is a sibling then something else is going on and we'll dig further. one other thing worth knowing, if isolate clamps your version back to something lower than you asked for it'll tell you, and that comes from the framework definition's supported PHP range rather than anything about your project. |
the command you're missing is lerd isolate. run lerd isolate 8.4 from inside the project and it'll write .php-version, update .lerd.yaml, update the site registry, and rebuild the FPM container and vhost, which is the same path the dashboard dropdown uses.
editing .lerd.yaml and .php-version by hand won't work once a site is linked. the CLI reads the version straight from the site registry at that point and those two files only get consulted for directories that aren't linked yet, so your edits were being ignored. that's deliberate, it stops composer running on a different PHP than the container actually serving the site, but it does make hand editing look broken, which is fair enough. le…