Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Estecado's avatar

php artisan migrate return Fatal error: Uncaught ErrorException: preg_match(): JIT compilation failed: no more memory

Hello everyone,

After a upgrade from Mac OS to Catalina, and a downgrade from MAMP Pro to MAMP, I get this error when I try this command :

$ php artisan migrate

I read several discussion about this error and always the answer is : edit your php.ini, and replace pcre.jit = 1 with pcre.jit = 0, to temporaly fix it.

But nothing change to me.

It's strange because it seems I use the good php.ini :

$ php -v PHP 7.3.8 (cli) (built: Aug 14 2019 16:42:46) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies

$ which php /Applications/MAMP/bin/php/php7.3.8/bin/php

And in MAMP phpinfo I have :

Loaded Configuration File /Applications/MAMP/bin/php/php7.3.8/conf/php.ini

[...]

PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 10.32 2018-09-10 PCRE Unicode Version 11.0.0 PCRE JIT Support enabled PCRE JIT Target x86 64bit (little endian + unaligned)

Directive Local Value Master Value pcre.backtrack_limit 1000000 1000000 pcre.jit 0 0 pcre.recursion_limit 100000 100000

Maybe I'm wrong and artisan use a different version of php ?

Thanks

0 likes
8 replies
mubashirali's avatar

Open your php.ini file and replace pcre.jit = 1 to pcre.jit = 0 then restart you server.

Estecado's avatar

Like I said, I have already replace pcre.jit = 1 to pcre.jit = 0 but the error still be there ;)

Tray2's avatar

Do you have a lot of migrations? Can you show the contents of the migration files?

Estecado's avatar

@tray2 Yes a lot, and there are many migrations files.. so this is hard to show you all this files... :)

But I had already installed this project on this mac last month without problem (and the command : $ php artisan migrate --seed, work fine).

To explain the context, I have upgraded my mac OS to Catalina, and I have uninstalled MAMP Pro, to keep MAMP free version only. But during this, all databases has been removed. So after create a new empty database for this laravel project, I proceed : $ php artisan migrate --seed, and the error show up.

Thx

Estecado's avatar

@nakov maybe I should now I'm on mac but for now I look for a solution to fix the problem with MAMP.

abdelrahman-mahmoud2025's avatar

okay IDK if my comment will be helpful or not but I have same error but i'm different I'am use XAMMP and face same thing in laravel but i'm use " sudo /Applications/XAMPP/xamppfiles/xampp restart " after edit this file (php.ini) and make sure this file used by installed php in my device (MBP 2011 late with High Sierra OS) by this command " /Applications/XAMPP/xamppfiles/bin/php -i | grep "Loaded Configuration File" " and change it to -1 IDK how it work but it's fine to fix it :)

Please or to participate in this conversation.