error PHP 7-4

ERRORS when switching to PHP 7.3 or 7.4

You webserver is on PHP 7 and you have an error listed bellow :

ERRORS when switching to PHP 7.4 – Warning: preg_match(): Allocation of JIT memo

Or :

Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /wp-includes/wp-db.php on line 1754

Or :

Warning: preg_replace(): JIT compilation failed: no more memory in /wordpress/wp-includes/formatting.php on line 2110 Warning: preg_match(): JIT compilation failed: no more memory in /wordpress/wp-includes/functions.php on line 4947 Warning: preg_replace(): JIT compilation failed: no more memory in /wordpress/wp-includes/functions.php on line 4843 Warning: preg_match(): JIT compilation failed: no more memory in /wordpress/wp-includes/functions.php on line 4947 Warning: preg_match(): JIT compilation failed: no more memory in /wordpress/wp-includes/functions.php on line 4947

The reason

It can happen when you upgrade the PHP version and some extensions (php extensions) are missing. For example MySQL extension which is required by WordPress.

The solution

Try to see into your hosting dashboard if some extensions are missing, like mysql extensions for example.

If it doesn’t work, try to fix it. You can edit your file php.ini (create it if it doesn’t exist) at the root of your FTP and add :

pcre.jit=0

Try again to run your WordPress. If it doesn’t work, then you should downgrade your PHP version.

On your host, choose an old php version. For example, if your version is PHP 7.3, downgrade to 7.2, then 7.1 and so on… until your website works. Then, start upgrading again PHP, in the same way. Stop if an error appears and verify if all extensions are installed or not.

Still stuck ? You can contact an expert.

Leave a Comment

Your email address will not be published.

You may also like