How to determine what's causing JIT status to shows as "Disabled" in phpinfo()

1.3k views Asked by At

I've set-up everything as best as I can and yet I see JIT status as Disabled.

Here's what I have:

echo (function_exists('opcache_get_status') 
      && opcache_get_status()['jit']['enabled']) ? 'JIT enabled' : 'JIT disabled';

Returns:

JIT disabled

Then I have this:

print_r([
            'opcache.jit' =>  ini_get("opcache.jit"),
            'opcache.enable' => ini_get('opcache.enable'),
            'opcache.enable_cli' => ini_get('opcache.enable_cli'),
            'opcache.jit_buffer_size' => ini_get('opcache.jit_buffer_size') 
    ]);

Returns:

Array
(
    [opcache.jit] => tracing
    [opcache.enable] => 1
    [opcache.enable_cli] => 1
    [opcache.jit_buffer_size] => 300M
)

And finally, this code:

opcache_get_status()['jit']

Returns:

array(7) {
  ["enabled"] => bool(false)
  ["on"] => bool(false)
  ["kind"] => int(5)
  ["opt_level"] => int(4)
  ["opt_flags"] => int(6)
  ["buffer_size"] => int(0)
  ["buffer_free"] => int(0)
}

What can I do, or where do I look to figure out why JIT status is false?

Edit: JIT is enabled via these lines in Cloudways panel, if that helps:

php_admin_value[opcache.enable]=1
php_admin_value[opcache.enable_cli]=1
php_admin_value[opcache.jit_buffer_size]=300M
2

There are 2 answers

0
arslan On

With Cloudways, at present one needs to create a ticket with their support, and:

  1. Explain to them how JIT is not working, give screenshot of the print_r output.

  2. Ask them to create a file:

    /etc/php/8.x/mods-available/30-jit.ini

Change 8.x to your version of PHP.

  1. Request them to paste the following contents in above file:

    opcache.enable=1

    opcache.jit_buffer_size=128M

    opcache.jit=1255

Adjust the values as needed

  1. Lastly ask them to enable the file by creating a soft link:

    ln -s /etc/php/8.x/mods-available/30-jit.ini /etc/php/8.x/fpm/conf.d/30-jit.ini

Until they fix their hosting dashboard, this is the only way I am able to get JIT working with Cloudways.

0
Ihor Bilyk On

I had same problem. In file /etc/php/8.1/mods-available/opcache.ini saw duplicated parametr opcache.jit=off. Replace it to opcache.jit=1255 and JIT will rinning