Upgrade.php conversion script returns a 404 page

I think it really is the valet driver (already included). Only allowing access to index.php and panel/index.php. K3 frontend and panel get served through the index.php - so no problem. But when you want to access upgrade.php, the driver blocks it.

I think so to. As i understand them, the drivers are a bridge between Valet and Nginx that tell it how to behave, I guess just have to wait for the Laravel guys to catch up and update the driver. I’ll pop over and raise an issue on Valets Github in a minute.

I fiddled around with the Valet+ driver (which should also fly for Valet) and got the upgrade working on a clean starter kit. I added an old style content folder and watched the script update it.

Just need to add this to the frontControllerPath method above the existing rule for index.php but below the panel rule:

if ($uri === '/upgrade.php')  {
    return $sitePath.'/upgrade.php';
}

Heres the full driver in a gist.

1 Like

Thanks for this James! I can’t get the gist to work as a custom Valet driver because it says the name is already in use. Should I edit the original KirbyValetDriver.php in Valet somewhere? If so, where is it located?

@lukehatfield this is for Valet+ (an unofficial fork or Valet that adds additional features) not the official Laravel Valet that I know you are running. This thread is also a year old and both Kirby and Valet have a come a long way since. I would suggest starting a new thread with your current issue.

The Valet driver kirby at the time wasnt quite up to speed with Kirby 3 - it was meant for Kirby 2 which is what the tweak in the driver i did was for (from what i remember.)

The Valet devs (with some help from some of us) actually fixed the built in driver for Kirby a long time ago so you shouldnt actually need this now.

@pedroborges and @mrunkel actually helped with the official driver so they may be able to help you here.

Since I only run the upgrade script locally once per project, I usually just comment out the default stuff in the index.php and paste the upgrade script there.

Alternatively you can copy the default Kirby driver to your project root and use it as a local driver. Don’t forget to rename the file and class name. After that you are free to tweak it.

You can run valet which to check if Valet is picking your local driver.