RuntimeException- Failed to execute regex- PREG_JIT_STACKLIMIT_ERROR

Edit on GitHub

Description

[RuntimeException]                                  
Failed to execute regex: PREG_JIT_STACKLIMIT_ERROR

This error is received when using composer (composer require) to add additional modules.

Cause

The error is thrown if the backtracking/recursion limit is not high enough.

Solution

Either increase the limits to your requirements or switch off PCRE’s just-in-time compilation in your php.ini:

pcre.jit=0

You can also switch off PCRE just in time compilation using your deploy.yml.

image:
  tag: ...
  php:
    ini:
      'pcre.jit': 0