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
With Cloudways, at present one needs to create a ticket with their support, and:
Explain to them how JIT is not working, give screenshot of the
print_r
output.Ask them to create a file:
/etc/php/8.x/mods-available/30-jit.ini
Change 8.x to your version of PHP.
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
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.