Skip to content

OPcache crash with new local exception page in Laravel 12.29+ on Windows #57171

@jfvoliveira

Description

@jfvoliveira

Laravel Version

12.29+

PHP Version

8.3.6

Database Driver & Version

MySQL 8.0.30

Description

Starting with Laravel 12.29, throwing exceptions causes Apache to crash with ERR_CONNECTION_RESET instead of displaying the Laravel error page when OPcache is enabled. This only happens with unhandled exceptions - abort(500) works correctly.

Additional Context

  • Works correctly: Laravel 12.28 and earlier
  • Breaks: Laravel 12.29+ (coincides with new local debug page)
  • Affected PHP versions: 8.2.x and 8.3.6 (both crash)
  • Workaround: Disable OPcache or use php_flag opcache.enable Off in .htaccess
  • Only affects: Unhandled exceptions (throw new Exception())
  • Works fine: Laravel's abort() function

Environment Details

  • Windows 11
  • PHP 8.2.x & 8.3.6 with minimal OPcache config (default settings, only zend_extension=opcache uncommented)
  • Apache 2.4.59 (via Laragon)
  • Fresh Laravel installation (reproduced on clean project)
  • Cannot test on other OS currently

Steps To Reproduce

  1. Install fresh Laravel 12.29+ project
  2. Enable OPcache in PHP (minimal config: just zend_extension=opcache)
  3. Create route: Route::get('/test', fn() => throw new \RuntimeException('Test'));
  4. Visit /test in browser
  5. Apache crashes and browser shows message ERR_CONNECTION_RESET

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions