安装Moodle遇php_intl.dll及opcache.enable检测失败问题求助
Hey there, let's work through these two problems one by one—they're pretty typical for Windows XAMPP + Moodle setups, so I've got some targeted steps for you:
1. Resolving php_intl.dll Loading Failure
Your command prompt error makes it clear the extension can't be loaded, and it's almost always either missing files or incorrect configuration. Let's dig in:
Verify the php_intl.dll file exists
Double-check thatD:\Moodle_34\server\php\ext\php_intl.dllactually exists. Sometimes XAMPP installs don't include this extension by default—if it's missing, grab the matching thread-safe version from the PHP 7.1.10 Windows binaries (XAMPP uses thread-safe PHP).Check ICU dependency files
Thephp_intl.dllrelies on several ICU library files (likeicuuc62.dll,icuin62.dll,icudt62.dll,icuio62.dll—version 62 matches PHP 7.1.x). These files need to go in your PHP root directory (D:\Moodle_34\server\php\), not theextfolder. If they're missing, copy them from the root of the PHP binaries zip you downloaded into your PHP folder.Confirm you're editing the right php.ini
XAMPP has separate php.ini files for Apache and the command line: Apache usesapache/bin/php.ini, while CLI usesphp/php.ini. Runphp --iniin command prompt to check the CLI's ini, and create aphpinfo.phpfile (with<?php phpinfo(); ?>) in your Apache htdocs to verify which ini Apache loads. In both files (or at least the Apache one), uncomment:extension=php_intl.dllAlso make sure
ext_dirpoints correctly to your extensions folder:ext_dir = "D:\Moodle_34\server\php\ext"Restart everything
After editing php.ini, fully restart Apache (don't just reload), and close/reopen your command prompt to apply changes.
2. Fixing opcache.enable Detection Failure
Opcache issues usually boil down to incorrect extension loading or misconfiguration:
Enable the Zend Opcache extension
In your Apache php.ini, find and uncomment the zend_extension line for opcache (it's a Zend extension, not a regular PHP extension):zend_extension=php_opcache.dllEnsure the path to
php_opcache.dllis correct (it lives in yourextfolder, so the relative path works ifext_diris set properly).Set opcache.enable to 1
Add or update these lines in php.ini (these are Moodle-recommended settings):opcache.enable=1 opcache.enable_cli=1 # Optional, but helps with CLI checks opcache.memory_consumption=128 opcache.max_accelerated_files=4000The critical line here is
opcache.enable=1.Restart Apache and verify
Restart Apache, then check yourphpinfo.phppage to see if the opcache section appears—this confirms it's loaded correctly. Then refresh Moodle's server check page.
Once you've gone through these steps, both checks should pass. If you're still stuck, double-check the phpinfo output to confirm which extensions are loaded—it'll help pinpoint where the config is failing.
内容的提问来源于stack exchange,提问作者Roy

