Skip to content

Instantly share code, notes, and snippets.

@DFurnes
Last active August 19, 2020 15:46
Show Gist options
  • Save DFurnes/5dad7f34a4d89fcdc1a7b83fcad39631 to your computer and use it in GitHub Desktop.
Save DFurnes/5dad7f34a4d89fcdc1a7b83fcad39631 to your computer and use it in GitHub Desktop.

Homestead PHP 7.4 Upgrade Guide (August 2020)

1. Update your Homestead settings:

Head into your Homestead directory (likely ~/Code/homestead) and open Homestead.yaml.

Remove the webdriver: true line & swap any php: "7.3" lines to php: "7.4", like this:

  features:
      - mongodb: true
      - mariadb: true
-     - webdriver: true


sites:
     - map: aurora.test
       to: /home/vagrant/Code/aurora/public
-      php: "7.3"
+      php: "7.4"

     - map: northstar.test
       to: /home/vagrant/Code/northstar/public
-      php: "7.3"
+      php: "7.4"

     - map: phoenix.test
       to: /home/vagrant/Code/phoenix-next/public
-      php: "7.3"
+      php: "7.4"
     
     - map: rogue.test
       to: /home/vagrant/Code/rogue/public
-      php: "7.3"
+      php: "7.4"
       
     - map: chompy.test
       to: /home/vagrant/Code/chompy/public
-      php: "7.3"
+      php: "7.4"

2. Upgrade Homestead:

Then, run the following commands from your Homestead directory.

This may take up to 30 minutes, so grab a coffee & read up on new features in PHP 7.4 while you wait! ☕

# Get the latest Homestead release and re-build:
git fetch --tags && git checkout v10.10.1
vagrant destroy && vagrant up

You will also lose all local databases when rebuilding your Homestead box, so you'll have to re-run migrations and seeders. In each application directory (and running inside your Homestead box), run the following command:

php artisan migrate --seed

If you hit any roadblocks, let me know & I'd be happy to jump on a call to troubleshoot!

@weerd
Copy link

weerd commented Aug 16, 2020

Dropping this here since there may be similar issues with other projects: DoSomething/rogue#1101

Not sure if maybe I was just running into something unique though...

@weerd
Copy link

weerd commented Aug 19, 2020

I just tried setting up Aurora from scratch as well and ran into the same issue, so I suspect it'll be universal to any apps we have configured to use the app_name:setup command.

@DFurnes
Copy link
Author

DFurnes commented Aug 19, 2020

Oh sorry, I didn't get a notification on this comment! Laravel introduced a runCommand method on the base Artisan command class, and so I renamed the version included in Environmentalist to runArtisanCommand in v0.0.6. We can also use the built-in if that works.

@weerd
Copy link

weerd commented Aug 19, 2020

Ah! Thanks for the info! Ok, I can clean it up to use the new one in a separate PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment