We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 884b780 + 1d6e9da commit 01b3cc4Copy full SHA for 01b3cc4
ext/pcre/php_pcre.c
@@ -801,6 +801,12 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
801
if (!pcre2_pattern_info(re, PCRE2_INFO_JITSIZE, &jit_size) && jit_size > 0) {
802
poptions |= PREG_JIT;
803
}
804
+ } else if (rc == PCRE2_ERROR_NOMEMORY) {
805
+ php_error_docref(NULL, E_WARNING,
806
+ "Allocation of JIT memory failed, PCRE JIT will be disabled. "
807
+ "This is likely caused by security restrictions. "
808
+ "Either grant PHP permission to allocate executable memory, or set pcre.jit=0");
809
+ PCRE_G(jit) = 0;
810
} else {
811
pcre2_get_error_message(rc, error, sizeof(error));
812
php_error_docref(NULL, E_WARNING, "JIT compilation failed: %s", error);
0 commit comments