![e889ee6f8ef5666e77cbd4928bffde76.gif](https://img.php1.cn/3cd4a/1eebe/cd5/8373b1277127c518.webp)
Moodle的安装过程
1.将下载好的Moodle3.8.2版本解压,并复制解压的moodle文件夹到E:\xampp\htdoc文件夹下
![d4b2b8b921961d8fae778cfb0586080e.png](https://img.php1.cn/3cd4a/1eebe/cd5/4fae50aeee651818.webp)
![5cf17fb007ba7a85a3fd77aa055bbf1e.png](https://img.php1.cn/3cd4a/94ce/a6e/865776f6fe3d5f59.jpeg)
2.通过谷歌浏览器输入localhost:81/moodle,会进入moodle的安装页面,要求选择安装语言(经过测试,选择中文安装成功后,英文语言包也会随着安装成功),笔者这里选择英文进行安装(谷歌浏览器提供对应的英文翻译,在安装过程中可以对照着看,且安装成功后,也可以更改为中文),读者若嫌麻烦,可以直接选择简体中文进行安装,点击“Next”
![0f442eb07127bbdcc586dd758de6886e.png](https://img.php1.cn/3cd4a/1eebe/cd5/a1be7872e8d4934f.webp)
3.进入路径选择页面,使用默认值,点击“Next”
![aac82b1c9d05da4c078b8b3d76ab8348.png](https://img.php1.cn/3cd4a/1eebe/cd5/0a0ce631ec450943.webp)
4.进入数据库驱动选择界面,使用默认,点击“Next”![c9c04ce1b47b5d49a8681da9c23610f7.png](https://img.php1.cn/3cd4a/1eebe/cd5/857a46d091981bac.webp)
5.数据库设置:
注意端口号(Database port)填写,若未对MySQL的端口修改过,则填写3306,若修改过,则填修改过的值(参见前文第二部分Xampp的配置6)
用户填写为:root
密码默认为空,不进行填写
点击“Next”,之后点击“Continue”
![2565e8e375eb52ba130124254e146722.png](https://img.php1.cn/3cd4a/1eebe/cd5/7494af3c1cda418d.webp)
![cfd546264faa6c899c7aaf5261b57120.png](https://img.php1.cn/3cd4a/1eebe/cd5/ed19db63ee478b98.png)
6.进入Moodle安装过程中最重要的部分,红色部分要求对几个文件做出修改,共八个问题需要解决,这里按顺序进行讲解
![a6a794c3b4efb5ee3d3212f49bd9e909.png](https://img.php1.cn/3cd4a/1eebe/cd5/780a3060eeed6a4e.webp)
![40d8bcc4021f50c1af43f1e21395b8be.png](https://img.php1.cn/3cd4a/1eebe/cd5/443b30bb45e66690.webp)
(1)第一个问题:
Wrong $CFG->dbtype: you need to change it in your config.php file, from 'mysql' to 'mariadb'.
错误$CFG->dbtype:您需要在config.php文件中将其从“ mysql”更改为“ mariadb”。
通过Editplus打开E:\xampp\htdocs\moodle目录下的config.php文件
![f8774934a6a5f768a4f3a5be3d06c754.png](https://img.php1.cn/3cd4a/1e618/c5a/d5d40da532c3a782.png)
![57796b17252a28d1cb81af4c87526823.png](https://img.php1.cn/3cd4a/9b0d/ae9/2d998ad7838fbf16.jpeg)
将$CFG->dbtype = 'mysqli';改为$CFG->dbtype = 'mariadb';滑动查看,修改后保存关闭
(2)第二、三、四、五个问题:
Intl extension is required to improve internationalization support, such as locale aware sorting and international domain names.
需要使用Intl扩展名才能改善国际化支持,例如,支持区域设置的排序和国际域名。
The XMLRPC extension is useful for web services and Moodle networking.
XMLRPC扩展对于Web服务和Moodle网络很有用。
Installing the optional SOAP extension is useful for web services and some plugins.
PHP操作码缓存可提高性能并降低内存需求,建议并完全支持OPcache扩展。
PHP opcode caching improves performance and lowers memory requirements, OPcache extension is recommended and fully supported.
PHP操作码缓存可提高性能并降低内存需求,建议并完全支持OPcache扩展
均对E:\xampp\php文件目录下的php.ini文件做出修改,通过Editplus打开php.ini文件,
![2d2853eb0c76f24eabc1f3b8397e9388.png](https://img.php1.cn/3cd4a/1eebe/cd5/8170a21e8dddfd22.webp)
![dad500abc7c2b4bbe6618ab627480198.png](https://img.php1.cn/3cd4a/1eebe/cd5/2d903861d5ad779c.png)
将intl,xmlrpc,soap前面的分号去掉(可以用查找功能);extension=intl改为extension=intl,;extension=soap改为extension=soap,;extension=xmlrpc改为extension=xmlrpc,并在[intl] 下添加以下代码:intl.default_locale = en_utf8 intl.error_level = E_WARNING在[opcache]末尾,[curl]之前添加以下代码zend_extension = php_opcache.dllopcache.enable = 1opcache.memory_consumption = 128opcache.max_accelerated_files = 10000opcache.revalidate_freq = 60; Required for Moodleopcache.use_cwd = 1opcache.validate_timestamps = 1opcache.save_comments = 1opcache.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最后在php.ini文档末尾添加以下代码:[ExtensionList]zend_extension=php_opcache.dll滑动查看,修改后保存关闭
(3)第六、七个问题
Your database uses Antelope as the file format. Full UTF-8 support in MySQL and MariaDB requires the Barracuda file format. Please switch to the Barracuda file format. See the documentation MySQL full unicode support for details.
您的数据库使用Antelope作为文件格式。MySQL和MariaDB中的完整UTF-8支持需要梭子鱼文件格式。请切换到梭子鱼文件格式。有关详细信息,请参见文档MySQL完全Unicode支持。
For full support of UTF-8 both MySQL and MariaDB require you to change your MySQL setting 'innodb_large_prefix' to 'ON'. See the documentation for further details.
为了完全支持UTF-8,MySQL和MariaDB都要求您将MySQL设置“ innodb_large_prefix”更改为“ ON”。有关更多详细信息,请参见文档。
需要对E:\xampp\mysql\bin文件目录下的my.ini文件做出修改,通过Editplus打开该文件
![832f1e9f8d7bcc843c935b604e452727.png](https://img.php1.cn/3cd4a/1eebe/cd5/d84f9786330d9e41.png)
![220cde2462d6ebca9720360075e4ae8a.png](https://img.php1.cn/3cd4a/1eebe/cd5/7d7ef3f69d479716.webp)
通过查找功能查找[client]、[mysqld]、[mysql]的位置,查看是否有以下代码,没有的需要添加[client]default-character-set = utf8mb4[mysqld]innodb_file_format = Barracudainnodb_file_per_table = 1innodb_large_prefix=1character-set-server = utf8mb4collation-server = utf8mb4_unicode_ciskip-character-set-client-handshake [mysql]default-character-set = utf8mb4滑动查看,修改后保存关闭
(4)第八个问题:
It has been detected that your site is not secured using HTTPS. It is strongly recommended to migrate your site to HTTPS for increased security and improved integration with other systems.
已检测到您的站点未使用HTTPS保护。强烈建议您将站点迁移到HTTPS,以提高安全性并改善与其他系统的集成。
这里需要设置SSL,可以不进行设置。
注:对于以上修改,均可以点击
,查看解决方法
6.完成5后,需要重启Apache和MySQL服务,即点击“Stop”后再点击“start”
![3c805f0c557bb793e1925dc2acebee76.png](https://img.php1.cn/3cd4a/1eebe/cd5/21e585a7e21fc7dc.png)
7.回到Moodle安装界面,点击“Reload”按钮,
出现以下提示后,点击“Continue”按钮
![9dd0de7619e77b49e58a6ac91ceba4b3.png](https://img.php1.cn/3cd4a/1eebe/cd5/8be1ccb5166feb93.webp)
8.进入以下界面,等待一段时间,这段时间应该是生成数据
![b92d82062137261ced15cc4eb9d4f09d.png](https://img.php1.cn/3cd4a/1eebe/cd5/99b88427bc9ce0dc.webp)
![2cf2899fb1f61d32afb4509f084030ef.png](https://img.php1.cn/3cd4a/1eebe/cd5/ed19db63ee478b98.png)
会出现以下提示,可忽略
![e90f5d822c8613c663da95941573145a.png](https://img.php1.cn/3cd4a/1eebe/cd5/a5d7215df572c386.webp)
出现“Continue”按钮时,点击
![7c4343c440a8d6c9c75a2ecc5036637f.png](https://img.php1.cn/3cd4a/1eebe/cd5/ed19db63ee478b98.png)
9.到此,moodle安装基本成功,接下来的一些操作,读者可以按照安装提示进行设置。安装过程中,可能会出现以下错误
![1961d9c348be62a16dfce841dd3df0f4.png](https://img.php1.cn/3cd4a/1eebe/cd5/ddcc574beb16294e.jpeg)
向读者推荐一篇论文,链接:
https://kns.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFQ&dbname=CJFDLAST2016&filename=DZRU201619062&v=MDQxODZxZlllUm5GeXJnVzd2QklUZlplN0c0SDlmTnBvOURab1I4ZVgxTHV4WVM3RGgxVDNxVHJXTTFGckNVUjc=
若读者在安装过程中有问题,可扫码加入QQ群Moodle学习群(1130014565),进行交流
![13b0312fa79cb5f0947cf1f9798c6226.png](https://img.php1.cn/3cd4a/1eebe/cd5/2fdc212433a29829.png)
![5837c28ff5cf10bafcb7e0f8b888e446.png](https://img.php1.cn/3cd4a/1eebe/cd5/d05d9dfd09a56332.webp)