Php jit 配置无法正常工作

问题描述 投票:0回答:1

我对 php8 jit 功能感到困惑 我的会议:

  • zend_extension=opcache
  • opcache.enable=1
  • opcache.enable_cli=1
  • opcache.jit=跟踪
  • opcache.jit_buffer_size=256M

但是在 opcache_get_status() 的转储中我有这样的东西:

[jit] => Array
        (
            [enabled] => 
            [on] => 
            [kind] => 5
            [opt_level] => 4
            [opt_flags] => 6
            [buffer_size] => 0
            [buffer_free] => 0
        )

从函数 opcache 转储获取配置

[directives] => Array
        (
            [opcache.enable] => 1
            [opcache.enable_cli] => 1
            [opcache.use_cwd] => 1
            [opcache.validate_timestamps] => 1
            [opcache.validate_permission] => 
            [opcache.validate_root] => 
            [opcache.dups_fix] => 
            [opcache.revalidate_path] => 
            [opcache.log_verbosity_level] => 1
            [opcache.memory_consumption] => 134217728
            [opcache.interned_strings_buffer] => 8
            [opcache.max_accelerated_files] => 10000
            [opcache.max_wasted_percentage] => 0.05
            [opcache.consistency_checks] => 0
            [opcache.force_restart_timeout] => 180
            [opcache.revalidate_freq] => 2
            [opcache.preferred_memory_model] => 
            [opcache.blacklist_filename] => 
            [opcache.max_file_size] => 0
            [opcache.error_log] => 
            [opcache.protect_memory] => 
            [opcache.save_comments] => 1
            [opcache.record_warnings] => 
            [opcache.enable_file_override] => 
            [opcache.optimization_level] => 2147401727
            [opcache.lockfile_path] => /tmp
            [opcache.file_cache] => 
            [opcache.file_cache_only] => 
            [opcache.file_cache_consistency_checks] => 1
            [opcache.file_update_protection] => 2
            [opcache.opt_debug_level] => 0
            [opcache.restrict_api] => 
            [opcache.huge_code_pages] => 
            [opcache.preload] => 
            [opcache.preload_user] => 
            [opcache.jit] => tracing
            [opcache.jit_buffer_size] => 268435456
            [opcache.jit_debug] => 0
            [opcache.jit_bisect_limit] => 0
            [opcache.jit_blacklist_root_trace] => 16
            [opcache.jit_blacklist_side_trace] => 8
            [opcache.jit_hot_func] => 127
            [opcache.jit_hot_loop] => 64
            [opcache.jit_hot_return] => 8
            [opcache.jit_hot_side_exit] => 8
            [opcache.jit_max_exit_counters] => 8192
            [opcache.jit_max_loop_unrolls] => 8
            [opcache.jit_max_polymorphic_calls] => 2
            [opcache.jit_max_recursive_calls] => 2
            [opcache.jit_max_recursive_returns] => 2
            [opcache.jit_max_root_traces] => 1024
            [opcache.jit_max_side_traces] => 128
            [opcache.jit_prof_threshold] => 0
        )

    [version] => Array
        (
            [version] => 8.0.14
            [opcache_product_name] => Zend OPcache
        )

代码:

<?=print_r(opcache_get_status(FALSE), TRUE)?>
and
<?=print_r(opcache_get_configuration(), TRUE)?> 

ini:

;configuration for php opcache module 
priority=10 
opcache.enable=1 
opcache.enable_cli=1 
opcache.jit=tracing 
opcache.jit_buffer_size=256M 

你可以看这里 伙计们,什么错了,该怎么做才能让它发挥作用

php ubuntu jit ubuntu-20.04
1个回答
0
投票

我发现这是因为我启用了 xDebug - 您需要禁用它才能使 JIT 运行。

按照本指南禁用它。

如果它不在您的

php.ini
文件中,它将位于 xDebug
ini
文件中 - 在
phpinfo()
中搜索“xdebug”,其中应该会列出一个文件,编辑该文件。

© www.soinside.com 2019 - 2024. All rights reserved.