如何确定什么导致JIT状态显示为“禁用”在phpinfo()中
我已经尽力设置了一切,但是我将JIT状态视为禁用。
这是我拥有的:
echo (function_exists('opcache_get_status')
&& opcache_get_status()['jit']['enabled']) ? 'JIT enabled' : 'JIT disabled';
返回:
JIT disabled
然后我有:
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')
]);
返回:
Array
(
[opcache.jit] => tracing
[opcache.enable] => 1
[opcache.enable_cli] => 1
[opcache.jit_buffer_size] => 300M
)
最后,此代码:
opcache_get_status()['jit']
返回:
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)
}
我该怎么办,或者我在哪里寻找jit状态为何 false ?
编辑:JIT通过Cloudways面板中的这些行启用,如果有帮助:
php_admin_value[opcache.enable]=1
php_admin_value[opcache.enable_cli]=1
php_admin_value[opcache.jit_buffer_size]=300M
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有同样的问题。在file/etc/php/8.1/mods-available/opcache.ini中,saw opcareated parametr opcache.jit = off。将其替换为opcache.jit = 1255,而JIT将冲洗
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
使用Cloudways,目前需要在其支持的情况下创建一张票,并且:
向他们解释JIT如何无法正常工作,给出
print_r
输出的屏幕截图。要求他们创建一个文件:
/etc/php/8.x/mods-available/30-jit.ini
将8.x更改为您的版本。
opcache.enable = 1
opcache.jit_buffer_size = 128m
opcache.jit = 1255
根据需要调整值
最后要求他们通过创建软链接来启用文件:
ln -s /etc/php/8.x/mods-available/30-jit.ini/etc/php/8.x/fpm/conf.d/conf.d/30-jit.ini
直到他们修复托管仪表板,这是我能够使JIT与Cloudways合作的唯一方法。
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.
在我的服务器上,文件位于
SO
中为我工作。
on my server the file was located in
so
worked for me.