如何确定什么导致JIT状态显示为“禁用”在phpinfo()中

发布于 2025-01-27 10:25:40 字数 1330 浏览 1 评论 0原文

我已经尽力设置了一切,但是我将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

满地尘埃落定 2025-02-03 10:25:40

我有同样的问题。在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

无人问我粥可暖 2025-02-03 10:25:40

使用Cloudways,目前需要在其支持的情况下创建一张票,并且:

  1. 向他们解释JIT如何无法正常工作,给出print_r输出的屏幕截图。

  2. 要求他们创建一个文件:

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

将8.x更改为您的版本。

  1. < p>请求他们粘贴以下文件:

    opcache.enable = 1

    opcache.jit_buffer_size = 128m

    opcache.jit = 1255

根据需要调整值

  1. 最后要求他们通过创建软链接来启用文件:

    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:

  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.

几度春秋 2025-02-03 10:25:40

在我的服务器上,文件位于

/opt/plesk/php/8.3/etc/php.d

SO

nano 30-jit.ini

中为我工作。

on my server the file was located in

/opt/plesk/php/8.3/etc/php.d

so

nano 30-jit.ini

worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文