Skip to main content
GrN.dk

Main navigation

  • Articles
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Drush Symfony PHP Errors in Drupal: A Safe, Practical Fix

By Greg Nowak. Last updated 2026-07-13.

When Drush fails with a Symfony or PHP fatal error, the stack trace can make the problem look deeper than it is. Often, the command is loading Drush from one installation and Symfony from another. A global Drush binary, a project’s vendor directory, and different PHP runtimes can combine into a toolchain that Composer never resolved or tested as one unit.

For an operations lead or agency team, this is more than a developer inconvenience. Drush may be part of deployments, cache rebuilds, database updates, cron tasks, and recovery procedures. The goal is therefore not just to silence today’s error. It is to restore a repeatable command-line environment.

What the EventDispatcher error is telling you

A fatal error involving Symfony\Component\EventDispatcher\EventDispatcher::dispatch() is characteristic of incompatible callers and components. Symfony changed the argument order of dispatch() during the Symfony 4.3 transition, so older tools paired with newer EventDispatcher code could fail immediately.

That history explains the symptom, but it does not prove that every EventDispatcher error has the same cause. Read the file paths in the stack trace. If they mix a global location such as /usr/local/bin or Composer’s global home with the Drupal project’s vendor directory, investigate the binary mismatch first. If every path belongs to the project, a contributed package or custom command may instead contain the incompatible call.

Diagnose before changing dependencies

Start in the directory containing the project’s composer.json. Run non-destructive checks before installing, removing, or upgrading anything:

pwd
command -v drush
php -v
composer config --global home
composer show drush/drush
vendor/bin/drush version
vendor/bin/drush status
composer why symfony/event-dispatcher
composer check-platform-reqs

command -v drush identifies the executable selected by the shell. The two vendor/bin/drush commands test the project copy explicitly. Composer’s why command shows which packages require EventDispatcher, while check-platform-reqs checks the real PHP runtime and extensions rather than relying on Composer’s configured platform value.

What you find Likely issue Next action
Project Drush works; plain drush fails Global binary or shell path Update scripts to call vendor/bin/drush
Both commands fail Project dependency or PHP problem Inspect Composer blockers and platform requirements
Only production fails Environment drift Compare PHP, extensions, lock file, and deployment steps
All stack-trace paths are project-local Package or custom-code incompatibility Identify the caller before changing Symfony
A quick decision matrix for separating path problems from genuine project incompatibilities.

The safest modern fix

If vendor/bin/drush status works, the immediate fix is operational: replace global drush calls in CI, deployment hooks, cron entries, and runbooks with the project binary. Do not leave production automation dependent on whichever tool happens to appear first in a user’s PATH.

If Drush is not a project dependency, add it in a development branch or controlled build environment—not as an improvised production-server change:

composer require drush/drush
vendor/bin/drush status
composer validate
git diff -- composer.json composer.lock

Composer will choose a suitable constraint when none is supplied, but that does not remove the need to review the result. Test the site’s normal Drush commands, commit both Composer files, and deploy the lock file through the established release process. If the proposed major cannot be installed, ask Composer for the blocker chain:

composer prohibits drush/drush ^13 --tree
composer prohibits drush/drush ^14 --tree

Choose a supported Drush line

As of 13 July 2026, the Drush compatibility table recommends Drush 13 for Drupal 10.2+ and Drupal 11, and Drush 14 for Drupal 11.3+ and Drupal 12. Both require PHP 8.3 or newer. Other combinations shown with a plain compatibility mark may still run, but Drush describes them as no longer supported.

Do not force a newer major with --ignore-platform-reqs, and do not patch the global Composer directory by installing individual Symfony packages. Those shortcuts hide the constraint that needs attention and can break another Drupal project using the same account.

Containing a legacy site

When a Drupal or PHP upgrade cannot happen immediately, contain the risk. Pin the compatible Drush major inside the repository, record the reason, isolate the site’s runtime, and add the upgrade dependency to the delivery plan. Compatibility can keep an urgent release moving; it should not be presented to stakeholders as a supported long-term platform.

Prevent the next failure

  • Keep Drush in each project’s composer.json and composer.lock.
  • Use vendor/bin/drush consistently in local, CI, staging, and production workflows.
  • Run composer check-platform-reqs during builds and stop deployment when it fails.
  • Review Drupal, Drush, and PHP compatibility together before approving upgrades.
  • Remove undocumented global packages and server-specific command aliases.

The technical fix is usually small; the lasting improvement is making the repository the source of truth for the command-line toolchain. If inherited Drupal environments or fragile deployment scripts are consuming too much agency time, Greg can help turn them into a documented, supportable delivery setup.

Related on GrN.dk

  • Drupal CMS 2.0 Speeds Marketing Site Rebuilds, but It Is Not Autopilot
  • Drupal's Automatic Updates Cleanup Got More Urgent After the Old API Shutdown
  • Form Spam Is a Lead-Quality Problem: A Practical Hardening Playbook

Need help with this kind of work?

Talk to Greg about Drupal delivery Get in touch with Greg.

Sources

  • Install — Drush
  • Composer command-line interface
  • Runtime Composer utilities
  • New in Symfony 4.3: Simpler event dispatching
Last modified
2026-07-13

Tags

  • Drupal
  • Drush
  • Composer
  • Symfony
  • php

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

KotobaMon title screen: the Japanese logo コトバモン over a low-poly 3D island with monsters, cherry-blossom trees and a trainer.
KotobaMon: Shipping a 3D Browser Game With No Build Step and Self-Hosted Voice
2026-07-19

A look at fantasy.grn.dk, a browser-based 3D game that teaches Japanese with no build step, procedural art and self-hosted AI voice, and what its constraints show about shipping interactive products fast and cheap.

Illustrated infographic summarizing: WordPress Forced an Emergency Update. Did Every Site Take It?
WordPress Forced an Emergency Update. Did Every Site Take It?
2026-07-18

WordPress pushed an emergency security update, but teams still need to confirm the right patched version and core integrity on every installation.

Illustrated infographic summarizing: IndexNow: Wire corrections and deletions into the CMS
IndexNow: Wire corrections and deletions into the CMS
2026-07-17

IndexNow works best when CMS workflows report updates, redirects and removals as well as new pages. Here is how to cover the full content lifecycle.

Illustrated infographic summarizing: The EU’s August AI Deadline Reaches Bots and Synthetic Content
The EU’s August AI Deadline Reaches Bots and Synthetic Content
2026-07-16

Article 50 applies from 2 August 2026. Businesses need to map AI touchpoints, clarify ownership, and put workable transparency controls in place.

Illustrated infographic summarizing: A Voice Agent Is Only Ready When the Human Handoff Works
A Voice Agent Is Only Ready When the Human Handoff Works
2026-07-15

A practical guide to voice agents that recognise failure, pass useful context to staff, protect customer data, and improve resolution after launch.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.