Maintenace Mode with CLI

Maintenace Mode with CLI

by Gabriel Fernández -
Number of replies: 4

Hello,

Bluehost upgraded to PHP 7, and our Moodle installation is 2.8. So we cannot login. I'm trying to migrate the database and MoodleData to a local server with PHP 5.5 to extract the resources.

However, I need to place Moodle in maintenance mode using CLI. But the shared hosting won't allow me to use sudo for obvious security reasons.

Is there another way to place Moodle in maintenance mode?

Average of ratings: -
In reply to Gabriel Fernández

Re: Maintenace Mode with CLI

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yes. Go to Admin | Server | Maintenance Mode.
In reply to Gabriel Fernández

Re: Maintenace Mode with CLI

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The documetation says
$ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable

I think doing it as any user who has read permissions in the moodle directory tree will work:
$ /usr/bin/php admin/cli/maintenance.php --enable