Local By Flywheel



If you’re using Local by Flywheel to work on your projects, there may be times where you need to make customizations to the PHP configuration when the site starts.

As long as the Local site is running the “Preferred” environment with PHP 7.3, you can push it straight to Flywheel. And if it’s running a different environment, don’t fret. Simply export the local site and re-import with the “Preferred” environment. In this WordPress tutorial we will go through all the main features of Local Lightning by Flywheel so that you can quickly and easily develop WordPress websi. Automatic site deployment (for Flywheel and WP Engine customers) Multisite support; There is also a Pro version with additional features like file sync, deployment to staging, and priority support for $20/month. Plus, a team version for $50/month. How to Use Local to Create a Local WordPress Website. Local by Flywheel uses Docker containers under the hood but takes care of many things in a really easy to use, friendly, and performant GUI. The other thing I like about it is that it can get SSL working locally easily and keeps DB backups in an easy-to-find place. It includes Mailhog and even has really cool add-ons available now.

Before getting started, note the following:

  1. At a high-level, Local will start a containerized environment,
  2. A containerized environment will have its own set of configuration every single time it starts
  3. This means that you cannot change any configuration to the OS-level installation to achieve the changes you need.

So what do we do?

Change Local PHP Settings

For example, say that you need to manage the memory_limit in PHP that runs for your current site. At the time of this article, the default memory limit is 256MB.

Depending on the size of your project, this could be too low. Instead, locate the following directory:

/Users/[your user name]/[your local directory]/[your site directory]/conf/php

Then find the following file:

php.ini.hbs

Open the file in your preferred editor and change the value for memory_limit to whatever you need (like 1024M 😅) then restart your site.

The amount of allocated memory should be changed from 256MB to a 1GB. To verify this, set up a file with a single call to phpinfo() and then view it in your editor.

Some Details

Local By Flywheel Linux

  • Local configuration files in the hbs format are in Handlebars templates.
  • Local uses the PHP configuration for a given site based on the settings of the php.ini.hbs file – nothing you change at the system level will change this.
  • Random, fun(?) fact: Local was once Pressmatic that I covered several times when it first came out.

I’ve switched all my local WordPress development over to Local by Flywheel. I heard about it from y’all when we did a poll not to long ago about local WordPress development. Bottom line: it’s really good. It does everything you want it to, well, with zero hassle, and nothing more.

Running Multiple WordPress Installs (PHP, MySQL, Web Server)

That’s kind of the whole point. Local by Flywheel spins up a local site for you with all the dependencies that WordPress needs. Just by picking a few options and giving the site a name, you’ve spun up a new WordPress install in a few seconds.

And it’s ready to go!

Nice UI

Surely what Local by Flywheel is doing under the hood is quite complicated, but the UI for the app isn’t at all. I’m a big fan of apps like this. The super clean UI makes everything feel so easy and simple, despite it actually being complex and powerful. Just the information and controls you need!

HTTPS (SSL)

The web is moving more and more toward all-HTTPS, which is fantastic. With all the setup options Local by Flywheel offers, you can get your production and development versions of your site pretty close. We should be taking that another step further and be working locally over HTTPS, if our production sites are.

Local by Flywheel doesn’t just make it easy, it automatically sets up HTTPS for you! And of course, it just works. You probably want to trust that local certificate though to make it even smoother.

But wait! Don’t follow my awkward and slightly complex instructions. There is a one-click button right in Local by Flywheel to trust the certificate.

Combining with CodeKit

For all my simple mostly-solo projects, I’ve long been a fan of having CodeKit watch the project, so I preprocess all my CSS and JavaScript, optimize my images, and all that good task runner stuff. That’s easy, just point the CodeKit browser refreshing URL at the Local by Flywheel URL.

Migrating

Another one-click button I love in Local by Flywheel is the one that jumps you right to Sequel Pro.

This was mighty handy for me as I was migrating from a couple of different setups. For a zillion years I used MAMP, and configured Sequel Pro to be my database manager. Then for a bit, I switched over to Docker to manage my local WordPress stuff, which was fun and interesting but was ultimately wasn’t as easy as I wanted it to be. I also used Sequel Pro when I was in that phase.

So I was able to really quickly export and import the databases where I needed them!

It’s also worth mentioning that if you don’t have an existing local setup you’re migrating from, but do have a production site, I highly recommend WP DB Migrate Pro for yanking down that production database in an extremely painless fashion.

Live Link

Local By Flywheel

As if that wasn’t enough, they tossed in one more really cool little feature. One click on the “Live Link” feature, and it fires up an ngrok URL for you. That’s a live-on-the-internet URL you can use to share your localhost. Send it to a client! Debug a mobile issue! Very cool.

Local By Flywheel For Windows

TLDR: I’m a fan of Local by Flywheel!