Setting up PHP for Local Development

Setting up PHP for Local Development

·

2 min read

I am building a new PHP application with PHP and Laravel.

Before, for MacOS, I typically installed PHP with Homebrew. Sometimes, I've even used Docker and things like Laravel Sail, however, those could sometimes have performance issues and there were still tools where I wanted PHP locally.

Recently, Laravel Herd was released to make this process much easier. I will use Herd to quickly get started. It is a tool for MacOS to quickly install everything needed to spin up a new Laravel or other PHP-based applications locally.

Installing Laravel Herd

If you have used something like Laravel Valet previously, Herd does much of the same, however, it is much faster to set up. Also, since Herd is using static binaries of PHP, it actually provides better performance than the Homebrew installations.

After completing the Herd installation, php, composer, and laravel will be available in your terminal. Any sites you place in the ~/Herd directory will be available in the browser. This path is configurable and additional paths can be added through the settings.

Laravel Herd - Services and PHP Versions

The settings also allow installing additional versions of PHP and quickly switching between them.

Now that we have Herd setup and PHP, Composer, and Laravel installed I will move on to setting up a Laravel application in a future post.

And thank you to the Laravel team and BeyondCode team for creating an amazing tool!


Continue Learning

Did you find this article valuable?

Support Sean Kegel by becoming a sponsor. Any amount is appreciated!