- Moodle 3 Administration(Third Edition)
- Alex Büchner
- 264字
- 2021-07-16 12:50:48
Installation via the Command Line Interface
Moodle provides a Command Line Interface (CLI), which lets you perform a number of administrative tasks from the Unix shell prompt. There is no CLI for Windows-based systems. CLI-based installations are useful if you need to automate setups, for example, in an environment where you have to host multiple Moodle instances.
The CLI is not for the faint-hearted, so be careful when using it. You have to execute the installation script as the same user used for the web server, usually www-data
or apache
. You can run the installation script, install.php
, in interactive mode (you will have to enter any parameters by hand) or in non-interactive mode where the script will run silently.
From your dirroot
, you can initiate the interactive script as follows:
sudo –u www-data /usr/bin/php admin/cli/install.php
More interesting is the non-interactive mode as this can be used for scripting and automation purposes. The list of all the available parameters is displayed using the --help
command:
sudo –u www-data /usr/bin/php admin/cli/install.php --help

An example command line would look similar to the following, where you will have to adjust the parameters to your local setup:
sudo -u www-data /usr/bin/php admin/cli/install.php --wwwroot=http://123.54.67.89/moodle --dataroot=/var/moodledata/ --dbtype=mysqli --dbhost=localhost --dbname=moodle --dbuser=moodle --dbpass=Password123! --fullname=moodle2 --shortname=moodle2 --adminpass=Password123! --non-interactive --agree-license
There are more Moodle tasks that can be administered via the CLI, for example, resetting passwords or putting Moodle in maintenance mode. We will show the relevant syntax at the appropriate places throughout the book.
Tip
If your installer crashes, you might have to increase your PHP memory_limit
and post_max_size
settings in php.ini
.
- Mastering RabbitMQ
- C++面向?qū)ο蟪绦蛟O(shè)計(微課版)
- Access 2010數(shù)據(jù)庫基礎(chǔ)與應(yīng)用項目式教程(第3版)
- Internet of Things with the Arduino Yún
- Java Web應(yīng)用開發(fā)技術(shù)與案例教程(第2版)
- Python機(jī)器學(xué)習(xí)實戰(zhàn)
- 零基礎(chǔ)入門學(xué)習(xí)Python
- Scala編程實戰(zhàn)(原書第2版)
- Go語言編程
- JavaScript機(jī)器人編程指南
- Mastering Elixir
- Moodle 3 Administration(Third Edition)
- Python 3 Object:oriented Programming(Second Edition)
- IPython Interactive Computing and Visualization Cookbook
- SQL Server 2008實用教程(第3版)