Sunday, December 30, 2018

How to resolve OPCache configuration issue when install Moodle?

Software Required

- macOS High Sierra
- XAMPP-VM/PHP 7.3.0. Please refer to download
- Moodle version 3.6.1. Please refer to download

Problem
  • During the Moodle installation on XAMPP, OPCache plugin checking message is displayed. Please refer to the screenshot below

Steps
  • To check the location of php.ini, browse to http://localhost:8080/dashboard/phpinfo.php
  • Obviously, php.ini is located at "/opt/lampp/etc/" directory
  • Uncomment ";" at the line 1031 to enable opcache library
zend_extension=opcache.so
    • Append the opcache configuration as shown below
    [opcache]
    opcache.enable = 1
    opcache.memory_consumption = 128
    opcache.max_accelerated_files = 10000
    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
    ;opcache.mmap_base = 0x20000000 ; (Windows only) fix OPcache crashes with event id 487
    
    ; 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.
        • Restart the XAMPP VM, the OPCache plugin checking message is not prompted anymore.

        No comments: