Moodle 中 OPcache 的配置

PHP.ini 配置:[code][opcache]
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60

; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0

; If something does not work in Moodle
;opcache.revalidate_path = 1 ; May fix problems with include paths

; Experimental for Moodle 2.6 and later
;opcache.fast_shutdown = 1
;opcache.enable_cli = 1 ; Speeds up CLI cron
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.[/code]如果你使用的是 IIS,你需要 PHP 5.5 版本,同时你需要将 opcache 扩展添加到 php.ini 文件的 ExtensionList 中。[ExtensionList] ... zend_extension=php_opcache.dll