Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preg_match(): JIT compilation failed: no more memory #7836

Closed
HoTKreeZy opened this issue Dec 13, 2018 · 25 comments
Closed

preg_match(): JIT compilation failed: no more memory #7836

HoTKreeZy opened this issue Dec 13, 2018 · 25 comments

Comments

@HoTKreeZy
Copy link

HoTKreeZy commented Dec 13, 2018

When I run this command:

 composer create-project symfony/website-skeleton my-project

I get the following output:

PHP Warning:  preg_match_all(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 137

Warning: preg_match_all(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 137

PHP Warning:  preg_match(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 755

Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 755
PHP Warning:  preg_match(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 759

Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 759
PHP Warning:  preg_split(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 654

Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 654
PHP Warning:  preg_split(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 1091

Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Application.php on line 1091
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 36

Warning: preg_replace(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 36
                                                        
  [ErrorException]                                      
  preg_match(): JIT compilation failed: no more memory  
                                                        

PHP Warning:  preg_match_all(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 199

Warning: preg_match_all(): JIT compilation failed: no more memory in phar:///usr/local/Cellar/composer/1.8.0/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 199

I have PHP 7.3 and Composer 1.8

@satoryu
Copy link

satoryu commented Dec 14, 2018

In my case, it works by specifying pcre.jit=0 in php.ini

@HoTKreeZy
Copy link
Author

HoTKreeZy commented Dec 14, 2018

Well.. I just upgraded my mac to Mojave and tried again and it's working now..
So I can't tell if your answer works but it will probably help someone else :)
Thank you anyway, i'll keep it aside :)

@Mx-Glitter
Copy link

Mx-Glitter commented Jan 1, 2019

I have the same problem on my Mac. Here are my versions:

PHP 7.3.0
Composer 1.8.0
MacOS High Sierra 10.13.6

Setting pcre.jit = 0 worked for me but it should be working without it, or maybe indicated in composer documentation, so I'd say maybe we should keep this issue opened, is that OK for you @HoTKreeZy?

I'll try upgrading my Mac later to see if everything is better afterwards.

@HoTKreeZy
Copy link
Author

HoTKreeZy commented Jan 2, 2019

I have the same versions for PHP and Composer but I'm using MacOs Mojave 10.14.2 and it's working well.

If you think that we should keep this issue opened, I'm OK.

@HoTKreeZy HoTKreeZy reopened this Jan 2, 2019
@pocketrocket
Copy link

pocketrocket commented Jan 8, 2019

In my case, it works by specifying pecr.jit=0 in php.ini

be carefull with typos ;) should be pcre.jit = 0

@alcohol
Copy link
Member

alcohol commented Jan 9, 2019

https://externals.io/message/87245 is interesting to read. Not sure if this should be solved on our end or not.

@alcohol
Copy link
Member

alcohol commented Jan 9, 2019

The errors originate from the symfony/console library btw, so it is not something we could solve directly either way.

@Sammaw93
Copy link

Sammaw93 commented Feb 6, 2019

pcre.jit = 0 worked fine for me 👍 thankss

@eliataylor
Copy link

eliataylor commented Feb 10, 2019

i'm still getting this error despite pcre.jit = 0 setting:

screen shot 2019-02-10 at 10 40 55 am

in my phpinfo above, i see "PCRE Jit Support" is "enabled" but the setting is indeed 0.

  • osX High Sierra 10.13.6
  • php 7.2.9
  • composer 1.8.3

@staabm
Copy link
Contributor

staabm commented Feb 10, 2019

It looks like you set jit=0 in the php.ini of your webserver. Make sure to have it configured in the php.ini used inside the cli. Usually these are 2 different files

@eliataylor
Copy link

eliataylor commented Feb 10, 2019

great point @staabm!!! forgot they are different.

ran php --ini and added my config to the additionals folder.

@lambirou
Copy link

lambirou commented Feb 27, 2019

pcre.jit = 0 in php.ini, worked fine for me olso 👍 thanks !

  • MacOS High Sierra 10.13.6
  • php 7.3.2
  • composer 1.8.3

@ag107
Copy link

ag107 commented Feb 27, 2019

If pcre.jit = 0 pcre.jit=0 pcre.jit = Off in php.ini, not worked, try this:

https://stackoverflow.com/a/53703630/9142922

I solved this by disabling the PCRE jit compilation.
I suppose you installed php 7.3 through homebrew.
If so, create a zzz-myphp.ini in /usr/local/etc/php/7.3/conf.d with the following content:

; My php.ini settings
; Fix for PCRE "JIT compilation failed" error
[Pcre]
pcre.jit=0
  • MacOS High Sierra 10.13.6
  • php 7.3.2
  • composer 1.8.4

@mattpaz
Copy link

mattpaz commented Apr 22, 2019

FYI - This also helped to correct (Thanks to @NickWilde1990 for the pointer!)

[RuntimeException]
Failed to execute regex: PREG_JIT_STACKLIMIT_ERROR

with

  • COMPOSER 1.8.5
  • PHP 7.3.2
  • OSX 10.14.3 (Mojave)

@mrlords
Copy link

mrlords commented May 13, 2019

Work to me fixing pcre.jit=0 MacOs Sierra using brew hhtpd and php

@kylemutta
Copy link

kylemutta commented Jun 12, 2019

guys am still getting the same error i diid add this pcre.jit=0

@sanmai
Copy link
Contributor

sanmai commented Jun 29, 2019

Verify that you really have it set:

$ php -i | grep pcre.jit
pcre.jit => 0 => 0

williamdes added a commit to williamdes/mariadb-mysql-kbs that referenced this issue Jun 30, 2019
williamdes added a commit to williamdes/mariadb-mysql-kbs that referenced this issue Jun 30, 2019
@kylemutta
Copy link

kylemutta commented Jul 1, 2019

@anhdq1801
Copy link

anhdq1801 commented Sep 23, 2019

It work for me by follow steps:

  1. Please open you Terminal and run php --ini
  2. Open file php.ini in the path "Loaded Configuration File: /usr/local/php5/lib/php.ini" https://prnt.sc/p9tspy
  3. Find pcre.jit and change ;pcre.jit=1 to pcre.jit=0

@RrNn
Copy link

RrNn commented Oct 11, 2019

And more to this, you might wanna do it for all versions. For my case, I set them both for php5 which i think was the default that came with my OS, macOS High Sierra 10.10.3 and for my fresh upgrade to php7.3, so, on my machine;

subl /usr/local/etc/php/7.3/php.ini

and look for ;pcre.jit=1 and make it pcre.jit=0 and do the same for the file

/usr/local/php5/lib/php.ini

which is for php5.
You don't have to use sublime to open these files 😁. But that's what printed pcre.jit => 0 => 0 on running the command php -i | grep pcre.jit in my terminal. A confirmation that pcre.jit is set to false

@samzillah
Copy link

samzillah commented Oct 7, 2020

In my case, it works by specifying pcre.jit=0 in php.ini

how do i go about setting this up in the terminat

@samzillah
Copy link

samzillah commented Oct 7, 2020

And more to this, you might wanna do it for all versions. For my case, I set them both for php5 which i think was the default that came with my OS, macOS High Sierra 10.10.3 and for my fresh upgrade to php7.3, so, on my machine;

subl /usr/local/etc/php/7.3/php.ini

and look for ;pcre.jit=1 and make it pcre.jit=0 and do the same for the file

/usr/local/php5/lib/php.ini

which is for php5.
You don't have to use sublime to open these files 😁. But that's what printed pcre.jit => 0 => 0 on running the command php -i | grep pcre.jit in my terminal. A confirmation that pcre.jit is set to false

please help me on how i can change this. Mine is pcre.jit => 1 => 1

@mhreza76
Copy link

mhreza76 commented Apr 20, 2021

You have to edit the php.ini file and add.

pcre.jit = 0

In XAMPP (Mac OSX), the php.ini file is in the /Applications/XAMPP/xamppfiles/etc folder.
In XAMPP (Windows), the php.ini file is in the C:\xampp\php folder.
Then run these commands,

composer global remove laravel/installer 
composer global require laravel/installer

@xtniloy
Copy link

xtniloy commented Jun 21, 2021

if there is a line already exist like ;pcre.jit=0 remove the semicolon ; before the line. The line should look like pcre.jit=0

@Valerioat
Copy link

Valerioat commented Oct 29, 2021

Funciona para mí siguiendo los pasos:

  1. Abra su Terminal y ejecute php --ini
  2. Abra el archivo php.ini en la ruta "Archivo de configuración cargado: /usr/local/php5/lib/php.ini" https://prnt.sc/p9tspy
  3. Encuentre pcre.jit y cambie; pcre.jit = 1 a pcre.jit = 0

y después reinician apache para que se aplique el cambio "sudo apachectl restart"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests