要显示特定文件(example.php)的操作码,有两个扩展名。VLD 和 Zend Opchache.
VLD有一个属性,当我们选择vld.execute=0的时候,可以不执行文件而生成操作码。
php -d vld.active=1 -d vld.execure=0 example.php
我的问题是:我可以用Zend Opcache生成opcode,但不执行文件吗?我可以用Zend Opcache生成opcode,但不执行文件吗?我需要在配置文件中修改什么才能有这个选项?
php -d opcache.opt_debug_level=0x10000 example.php
是的,通过调用 opcache_compile_file()
并将文件路径传给它。
你可以在CLI中这样做。
php -d opcache.opt_debug_level=0x10000 -r 'opcache_compile_file("example.php");'