by Chris Douglas.
Just installed... Moodle 3.7.2 on Windows Server 2019, IIS 10, PHP 7.2 & Mairadb 10.4. Just after first configuration and log-in, interface would stop with PHP Fatal error on memory. One of two messages depending on whether I set memory_limit in php.ini to a number (tried 128, 256, 1024, 2048) or to -1. Allowed memory error on a number, Out of memory error on -1.
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4121125927079325552 bytes) in C:\inetpub\wwwroot\moodle\lib\setuplib.php on line 783
PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 4121125927079325552 bytes) in C:\inetpub\wwwroot\moodle\lib\setuplib.php on line 783
Determined that disabling opcache (opcache.enable = 0) resolves the error and allows the server to run just fine, albeit probably slow with the cache off. Everything seems to work.
I've researched and found opcache settings ideas here and via google but nothing has worked so far. Starting with the default [opcache] and "required for Moodle" and adding other ideas I've found - even adding them one at a time and testing them as whole solutions and singular lines in every possible combination, I'm still crashing. So here is where my [opcache] settings stand now, any suggestions for how to find my problem and resolve it are much appreciated:
[opcache]
zend_extension = php_opcache.dll
opcache.enable = 0
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
; Opcache enable causes memory error fix?: https://bugs.php.net/bug.php?id=78076
opcache.enable_cli=1
opcache.file_cache="/var/lib/php/cli-opcache"
opcache.file_cache_only=1
; 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