Shiphp The PHP Developer's Guide

Dan Pastusek and Seandon Mooy on KubeSail and Simplifying Kubernetes

I’ve been using Docker for local development and continuous integration environments for several years now, but have always struggled more with production deploys. At first, orchestration tools were almost non-existent so everyone deployed Docker differently, but now as Kubernetes has become the dominant force in production containers, it’s star... Read more

Optimizing MySQL View Queries

Last year I started logging slow requests using PHP-FPM’s slow request log. This tool provides a very helpful, high level view of which requests to your website are not performing well, and it can help you find bugs, memory leaks, and optimizations for your database queries. After a few weeks, I noticed that two requests were especially slow - ... Read more

Announcing the Russian Translation of 'Building Your First PHP Application with Docker'

It’s been almost a year exactly since I first published Building PHP Applications in Docker, and today I’m excited to announce that it is now available in Russian! I can’t take any credit for this translation; Alexey Pyltsyn reached out and generously offered to do the translation for free. Since I don’t speak Russian, I can’t verify the accu... Read more

Building a Single NGinx Docker Image For All My PHP-FPM Containers

Lately I’ve been working to deploy a suite of PHP microservices using Docker containers. One of the problems is that our PHP applications are set up to work with PHP-FPM and Nginx (instead of the admittedly simpler Apache/PHP setup covered here), so each PHP microservice needs two containers (and by extension, two Docker images): a PHP-FPM conta... Read more

Debugging Intermittent Test Failures with Bash and PHPUnit

If you’ve been writing PHPUnit tests for long, you’ve probably run into a time when a test works 90% of the time, but every now and then it throws an unexpected error or failure. If it happens only rarely, you might just get around it by re-running your test suite, but if you’ve got a large test suite or intermittent failures become really commo... Read more

Running SQLite in PHP with Docker

SQLite is a great database for getting started on small projects. Unlike traditional SQL databases (like MySQL or Postgres), SQLite stores all your records in a single flat file that you can easily edit, transfer, or even check into version control (if your project warrants it). Another great feature of SQLite is that it’s built into the defaul... Read more

Testing Your Code with Multiple Versions of PHP Using Docker

About a year ago, I spent some time working with an open source project called PHP Crud API. The project creates a RESTful API from a relational database using a single PHP script. It’s quite an impressive feat of engineering, but as I started working on the project, I realized I needed a reliable way to test my changes in different versions of ... Read more

Class Property and Method Visibility in PHP

Have you ever been confused by the difference between “private” and “protected” properties in PHP? Do you have to declare all your properties as “public”? What would you use a “private” method for? If you’ve ever had questions about method or property visibility in PHP, read on. I hope this post will improve your understanding of Classes in ... Read more

Interview with Shipyard's Creator, Italo Baeza

Over the past month, I’ve been talking to other developers who work with PHP and Docker about the tools and resources they use to make managing Docker easier. This week, I’m sharing a short interview with Italo Baeza, the creator of Laravel Shipyard, an open source project that helps Laravel developers (and really all PHP developers) get a whole... Read more

Ben Maggacis on Codemason and Deploying with Docker

Once PHP developers get familiar with the basics of local development with Docker, the next thing they always ask me about is deploying their projects. Running containers in production is a complicated problem, and because each project is different, there’s not just one solution that works for everyone. I’ve written before about using Hyper.sh, ... Read more