1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

apache2/php.ini fixes for Moodle e.g. 'max_input_vars = 5000'

This commit is contained in:
root 2021-06-28 17:29:58 +00:00
parent e31010d327
commit 28279bdbbf

View file

@ -50,9 +50,9 @@
lxde_present.stat.exists and chromium_present.stat.exists
- debug:
msg: 'THE 3 ANSIBLE STANZAS BELOW ONLY RUN... when: moodle_install or nextcloud_install or pbx_install or wordpress_install'
msg: 'THE 5 ANSIBLE STANZAS BELOW ONLY RUN... when: moodle_install or nextcloud_install or pbx_install or wordpress_install'
- block: # 3-STANZA BLOCK BEGINS
- block: # 5-STANZA BLOCK BEGINS
# roles/nginx has installed pkg 'php{{ php_version }}-fpm' in 3-base-server
@ -69,7 +69,7 @@
- { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
- { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is 128M / Nextcloud requests 512M' }
- { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requests 5000' }
when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 3-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
# 2020-03-08: IIAB does not support uninstalling apps, so a 3rd clause
# (to reset/restore PHP's defaults) is not necessary at this time.
@ -91,14 +91,35 @@
- { 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+ requests 5000' }
when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 3-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
- name: Restart 'php{{ php_version }}-fpm' systemd service
systemd:
name: php{{ php_version }}-fpm
state: restarted
when: moodle_install or nextcloud_install or pbx_install or wordpress_install # 3-STANZA BLOCK ENDS
- 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 }}/fpm/php.ini"
path: "/etc/php/{{ php_version }}/{{ apache_service }}/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+ requests 5000' }
when: moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
- name: Restart {{ apache_service }} systemd service
systemd:
name: "{{ apache_service }}"
state: restarted
when: moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: moodle_install or nextcloud_install or pbx_install or wordpress_install
when: moodle_install or nextcloud_install or pbx_install or wordpress_install # 5-STANZA BLOCK ENDS
# 'Is a "Rapid Power Off" button possible for low-electricity environments?'