phpjitopcache

JIT for PHP 8.1.21 will cause 503 server error


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.

Update 2

After upgrading to PHP 8.2.15, the error disappears. Thank you very much for all your attention and helps.

Update 3 After enabling JIT in PHP 8.2.15, one of our WP site deadlocked twice for unknown reason. So we have to disable JIT again. After observing for one week, the deadlock never occurs again after JIT is disabled. So I think JIT may still not be very stable at the PHP 8.2.15.


Solution

  • 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.)