3

I try to follow the instructions here to enable JIT in PHP 8.1.21

I set the JIT buffer size to 256M, as below:

opcache.jit_buffer_size=256M

I also enabled opcache.enable_cli as this article suggests me to do so

opcache.enable=1
opcache.enable_cli=1

After that, I restart PHP FPM service.

Then I check https://www.example.com/opcache.php and everything is correct, jit buffer size is 256MB. And then I check https://www.example.com/phpinfo.php which also shows JIT is ON.

Then I visit one page on the test site, https://www.example.com/, I will get " 503 Service Unavailable error".

Then If I go back to https://www.example.com/opcache.php, I will also get 503 error.

It seems that once we try to use JIT, there will be 503 error. Why?

I check the Apache error log, and see the following:

[Wed Jul 19 09:40:46.504648 2023] [proxy_fcgi:error] [pid 5914:tid 47200906626816] [remote 79.107.70.235:1854] AH01067: Failed to read FastCGI header
[Wed Jul 19 09:40:46.504677 2023] [proxy_fcgi:error] [pid 5914:tid 47200906626816] (104)Connection reset by peer: [remote 79.107.70.235:1854] AH01075: Error dispatching request to :

Update:

The PHP version is 8.1.21.

alancc
  • 487
  • 2
  • 24
  • 68
  • @hakre, yes, I enable OPCache as well, not just for CLI – alancc Jul 21 '23 at 10:55
  • 1
    Check with the log of the fastgi handler/PHP, from the apache error log it is already visible that the connection was reset. – hakre Jul 27 '23 at 10:04
  • can you post the output of `php -m`, phpinfo (`php -i`) would help to pinpoint the problem... I'd guess you have some incompatible extensions (ioncube, xdebug, ...) – kaznovac Jul 29 '23 at 20:24
  • 2
    you say PHP8.1, but which PHP version exactly? PHP8.1.0? or 8.1.21? A lot of JIT bugs has been fixed between 8.1.0 and 8.1.21 – hanshenrik Jul 30 '23 at 15:02
  • @alancc: The exact version of your PHP FPM service you're having this issue with is still missing in your question. – hakre Aug 04 '23 at 18:03
  • @hakre, Sorry about that. Actually I have already updated the PHP version info several days ago. However, it seems the info disappears for some reason. So I update again. – alancc Aug 05 '23 at 04:08
  • @hakre It is always 8.1.21 before & after the update. The problem is still exists. I think may be I need to wait for some more time to see new updates of PHP & extension available to fix this issue. – alancc Aug 05 '23 at 05:48
  • Check with the **log of the fastgi handler/PHP**, from the apache error log it is already visible that the connection was reset. <- did you do that? You didn't provide any more log details, therefore ... perhaps that's why I had the other impression. – hakre Aug 05 '23 at 06:32
  • @hakre, Actually I have checked PHP/FPM log but does not find anything. – alancc Aug 05 '23 at 10:44

1 Answers1

1

You're using PHP<=8.1.14 and hitting PHP bug GH-9981 ?!

In this case, the solution is to upgrade to PHP>=8.1.15, because that bug was fixed in PHP8.1.15. (but preferably upgrade to PHP >=8.1.21.)

hakre
  • 193,403
  • 52
  • 435
  • 836
hanshenrik
  • 19,904
  • 4
  • 43
  • 89