array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.opcache-compile-file.php', 1 => 'opcache_compile_file', ), 'up' => array ( 0 => 'ref.opcache.php', 1 => 'OPcache 函数', ), 'prev' => array ( 0 => 'ref.opcache.php', 1 => 'OPcache 函数', ), 'next' => array ( 0 => 'function.opcache-get-configuration.php', 1 => 'opcache_get_configuration', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/opcache/functions/opcache-compile-file.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.5.5, PHP 7, PHP 8, PECL ZendOpcache > 7.0.2)
opcache_compile_file — 无需运行,即可编译并缓存 PHP 脚本
该函数可以用于在不用运行某个 PHP 脚本的情况下,编译该 PHP 脚本并将其添加到字节码缓存中去。 该函数可用于在 Web 服务器重启之后初始化缓存,以供后续请求调用。
filename
被编译的 PHP 脚本的路径。