1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

fpm/php.ini + cli/php.ini + apache2/php.ini for Moodle

This commit is contained in:
root 2021-06-28 21:59:28 +00:00
parent 5afc1a0bc2
commit 2f47074710
2 changed files with 62 additions and 33 deletions

View file

@ -1,9 +1,12 @@
# 2021-05-22: FYI nginx_high_php_limits is effectively now auto-enabled by
# www_options/tasks/main.yml#L81-L94 (as required by Moodle 3.11 with PHP 8) IF
# www_options/tasks/main.yml#L100-L112 (as required by Moodle 3.11 w/ PHP 8) IF
# 'moodle_install: True'. Happens at the end of 4-server-options/tasks/main.yml
# See the 6 settings in /etc/php/{{ php_version }}/fpm/php.ini -- which Moodle
# should take advantage of soon, as it transitions from Apache to Moodle: #2785
# 2021-06-28: This ALSO now happens in /etc/php/{{ php_version }}/cli/php.ini
# (as required by Moodle's CLI installer) AND THIRDLY below (for now, until
# Moodle's ported to NGINX!) in /etc/php/{{ php_version }}/apache2/php.ini
- name: "Set 'apache_install: True' and 'apache_enabled: True'"
set_fact:
@ -14,6 +17,21 @@
include_role:
name: httpd
- name: "Enact the equivalent of 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/{{ apache_service }}/php.ini for Moodle 3.11+"
lineinfile:
path: /etc/php/{{ php_version }}/{{ apache_service }}/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/cli/php.ini
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
- { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
# Apache's restarted prior to moodle_installer below, so no need right here!
- name: "Set 'postgresql_install: True' and 'postgresql_enabled: True'"
set_fact:
@ -139,7 +157,7 @@
path: "{{ moodle_base }}/config.php"
register: config
- name: Execute {{ moodle_base }}/moodle_installer
- name: Execute {{ moodle_base }}/moodle_installer -- REQUIRES 'max_input_vars = 5000' (or higher) in /etc/php/{{ php_version }}/cli/php.ini with PHP 8+ (as set up by www_options/tasks/main.yml) -- WHEREAS Moodle uses /etc/php/{{ php_version }}/{{ apache_service }}/php.ini or /etc/php/{{ php_version }}/fpm/php.ini during regular operation
shell: "{{ moodle_base }}/moodle_installer"
when: config.stat.exists is defined and not config.stat.exists