Skip to content

Concurrency::run fails silently if zlib.output_compression is turned on #59112

@dj0rdj3

Description

@dj0rdj3

Laravel Version

12.53.0

PHP Version

8.4.13

Database Driver & Version

No response

Description

Concurrency::run fails silently when zlib.output_compression is enabled. The only visible error is Trying to access array offset on null at ProcessDriver.php:51. After much investigation, it turns out that zlib.output_compression = On in php.ini appends compressed binary data to the child process stdout after the JSON payload. json_decode returns null on the corrupted string, causing the array offset error in the parent.
Suggested fix: add a check in ProcessDriver::run() before spawning processes:

if (ini_get('zlib.output_compression')) {
    throw new \RuntimeException('Concurrency process driver requires zlib.output_compression to be disabled.');
}

Steps To Reproduce

In php.ini, set zlib.output_compression = On
Call the following code from any controller:

Concurrency::run([fn() => sleep(1)]);

Observe the cryptic Trying to access array offset on null error at ProcessDriver.php:51

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions