Symfony + Roadrunner: how to debug your app?

Alexey Alshenetsky
Mar 23 · 1 min read

Many modern PHP applications no longer work according to the old model of «shared nothing», which does not preserve state between requests. In this regard Preload appeared in PHP 7.4, but while it does not work quite stably, using Roadrunner is a very good solution.

The last one, unfortunately, imposes some inconvenience on the familiar development process. Popular PHP frameworks (Laravel, Symfony) use the symfony/var-dumper component, which conflicts with Roadrunner executing from php-cli. If you try to use dd() or dump() function, you will see the following:

worker error: invalid data found in the buffer (possible echo)

How to solve this issue?

For Symfony, use symfony-roadrunner-bundle. This bundle allows you to use dd() function exactly the same way you already know. Also there is a similar package for Laravel: stacked-dumper-laravel.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade