Talk:Installing Moodle on Debian based distributions

From MoodleDocs

TODO Suggest that the mysql secure utility is used. I refer to it in my Amazon EC2 install page. Copy & paste from there. Mention the various extra that need to be installed php-pear etc. Test php by using a phpinfo page

Partially Outdated

This site focuses on Debian 11 and different version issues when using it. However, Debian 12 was released almost 2 years ago with Debian 13 likely being released in Q3 this year. I suggest preceding the current content with a distinct section for Debian 12 that is much shorter and to the point on how to install Moodle on the current stable version. PHP versions as well as *sql versions nicely match the required versions of Moodle 5. If there are no objections, I'll gladly add an installation guide for Debian 12 BEFORE the current content. --Gerald Senarclens de Grancy (talk) 09:43, 26 April 2025 (UTC)

Reply to Gerald Senarclents

Sure Gerald Senarclens de Grancy go ahead --Mary Cooch (talk) 12:45, 29 April 2025 (UTC)

Adding extensions like

extension=mysql.so extension=gd.so

is only supported for legacy reasond (the .so should not be there) and afaik not needed at all as extensions installed in Debian via `apt` are enabled via /etc/php/8.2/mods-available

However, it may be best to shorten actually remove this, at least for Debian 12.

"Secure MySQL server"

Debian (and Ubuntu) MySQL server installation prompts the user to set a password for MySQL root. You can see the corr. dialog in the section MySQL, commented as (set the mysql-root password). So "mysqladmin -u root password 'new-password'" thing is obsolete. Visvanath Ratnaweera 01:40, 17 February 2012 (WST)

PHP modules and phpinfo()

Yes, the list of the necessary PHP modules is incomplete.

I want to count them seperately for each Moodle version. The list for 1.9 is there, the others will come as I do a test installation for each version.

Yes, I should add the story of "phpinfo();" single liner. Will do.

Thanks for the feedback. Visvanath Ratnaweera 01:46, 17 February 2012 (WST)


Various updates

Switch to MariaDB

I don't know why MySQL is used, perhaps Moodle used to require this when the instructions were first written? But Moodle supports MariaDB now, and that's what's packaged with Debian, so may as well use it?

  • Drop "I have included instructions on how to install MySQL...".
  • On line "Install LAMP: ..." change "mysql-server" to "mariadb-server".
  • Change "/etc/init.d/mysql restart" to "/etc/init.d/mariadb restart".
  • For Step 8, say to specify MariaDB for the database.

Remove PHP version number

PHP7.1 is no longer supported by Moodle or packaged with Debian (actually, not sure this version ever was packaged with Debian?), and Debian seems to have dummy packages without version numbers that depend on a suggested version. Perhaps use these?

  • On line "Install LAMP: ...", replace occurrences of "php7.1" with just "php"

Maybe replace other instances of the version number with "x.x" or something?

  • On lines with "gedit"/"nano" then "/etc/php/7.1/..." change "7.1" to "x.x"?

Update required PHP extensions

Moodle now seems to require the PHP xml extension, and the mysql driver (also used for MariaDB?) needs to be loaded in two parts, I think?

  • On line "Install LAMP: ...", add "php-xml".
  • In the section with lines "extension=..." add a line for "xml", and replace the line "mysql" with lines for "mysqlnd" and "mysqli".
  • Also, maybe drop the ".so" file extensions?--these are deprecated, apparently.

phpinfo

Bits were left out here, I think?

  • Replace code "<?phpinfo()?>" with "<?php phpinfo(); ?>".
  • Change "save it at /var/www", appending "/html".
  • Change "access this file through browser localhost/phpinfo", appending ".php".

Apache site config

This seems to be a bit different in the latest Debian.

  • Change line "nano /etc/apache2/sites-available/default", replacing "default" with "000-default.conf"?
  • On line "On about line 4, change DocumentRoot ..." drop "On about line 4"--this is now line 12 in Debian 11 (bullseye).
  • On line "On about line 10, change <Directory ..." maybe drop "On about line 10", and add "If present" (it no longer is).
  • On line "Around line 17, comment out the line for the default page:" maybe drop "Around line 17", and add "If present" (it no longer is).

James Calder 4 August 2021