Distributing PHP applications is quite complicated. For instance, to run a Symfony project in production, a web server, the PHP engine, and the appropriate PHP extensions need to be installed. Their versions and configurations must be compatible with the app. Because PHP is an interpreted language, the application source code must also be available. Composer dependencies as well… and things are even more difficult if some of them are private.
Of course, these days, containers can help. But what if we could make things even simpler: a single distributable binary that’s self-executing? Download a single file, give it the execution bit, and type “./my-app php-server”: boom! Your Symfony application is up and running, served over HTTP/3 with a valid TLS certificate! If you also want to distribute CLI commands written in PHP, we’ve got your back.
Thanks to the latest features of FrankenPHP, the dream is now a reality! Let’s discover how to ship PHP and Symfony applications as standalone binaries, web server, PHP included!
Here are the slides I presented at SymfonyCon Brussels introducing this feature: