简体   繁体   English

PHP 5.5.5可以从OPcache加载Phar文件吗?

[英]Can PHP 5.5.5 load Phar files from OPcache?

The version of PHP in use is 5.5.5 and I know this version of PHP can store precompiled script bytecode in shared memory, as mentioned in the following page: http://php.net/manual/en/intro.opcache.php 使用的PHP版本是5.5.5,我知道这个版本的PHP可以在共享内存中存储预编译的脚本字节码,如下页所述: http//php.net/manual/en/intro.opcache.php

I also know OPcache can compile files as mentioned in the following page: http://php.net/manual/en/function.opcache-compile-file.php 我也知道OPcache可以编译文件,如下页所述: http ://php.net/manual/en/function.opcache-compile-file.php

Which would be great if this worked with Phar files. 如果这与Phar文件一起使用会更好。 However, I can't tell whether PHP is loading my Phar files from bytecode in shared memory or not. 但是,我无法判断PHP是否从共享内存中的字节码加载我的Phar文件。 I can't use the opcache_is_script_cached function to test because this is not available in PHP 5.5.5, the function is only available in PHP 5.6 and newer. 我无法使用opcache_is_script_cached函数进行测试,因为这在PHP 5.5.5中不可用,该函数仅在PHP 5.6及更高版本中可用。

Could someone please clarify if this works or not, or at least explain to me how I can find out? 有人可以澄清这是否有效,或者至少向我解释我如何找到答案?

Yes it does. 是的,它确实。 I won't go through the whole thing, but there is logic in ext/opcache/ZendAccelerator.c 我不会完成整个过程,但在ext/opcache/ZendAccelerator.c有逻辑

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM