6

I just have installed xampp with php 7.3.1 on mac with OS El capitan.

The problem that when i run a WordPress project will show:

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

3
  • do you get more verbose errors in your error log. seeing the stack trace on that would be helpful
    – mrben522
    Commented Jan 22, 2019 at 14:17
  • I'm getting the same errors on my local installation. I have to refresh every new page load to temporarily hide the errors. Commented Jan 23, 2019 at 15:55
  • @PaulShryock I did downgrade to old php 7.1 and fixed. Thanks Commented Jan 23, 2019 at 19:57

2 Answers 2

10

I added the following line to the php.ini and restarted Apache and it worked (Xampp on macOS):

pcre.jit=0

This disables PCRE's just-in-time compilation.

Further information:

If you can't find the location of php.ini and are using Xampp, go to localhost and select the PHP information link and it is displayed there.

3
  • This answer looks good - I would add a link to the manual for this specific option to add context: php.net/manual/en/pcre.configuration.php#ini.pcre.jit
    – phatskat
    Commented Feb 4, 2019 at 2:48
  • For me this didn't work. Then I added 'php_value pcre.jit 0' to my .htaccess and that fixed it for me.
    – Niqql
    Commented Feb 26, 2019 at 9:33
  • This worked for me. I would expect that the reason that it didn't work for @Niqql is that they changed the wrong php.ini file (there are often several and figuring out which one is the correct one) That said, their solution is just as good. Maybe even better because it only effects the site below it in the file tree.
    – vlasits
    Commented May 24, 2019 at 18:07
0

You need downgrade your php7.3 to php7.1 version. I have the same problem when trying to change php version to the upper.

Not the answer you're looking for? Browse other questions tagged or ask your own question.