This commit is contained in:
Colan Schwartz 2024-01-31 22:01:49 -07:00 committed by GitHub
commit 1b50246c02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 0 deletions

View File

@ -69,6 +69,10 @@ php_enable_apc: true
php_apc_shm_size: "96M"
php_apc_enable_cli: "0"
# Manage PHP CLI memory limit.
php_set_cli_memory_limit: false
php_cli_memory_limit: "512M"
# If this is set to false, none of the following options will have any effect.
# Any and all changes to /etc/php.ini will be your responsibility.
php_use_managed_ini: true

14
tasks/configure-cli.yml Normal file
View File

@ -0,0 +1,14 @@
---
- name: Set PHP CLI memory limit.
block:
- name: Ensure PHP CLI config directory exists.
file:
dest: "/etc/php/{{ php_default_version_debian }}/cli/conf.d/"
state: directory
- name: Set PHP CLI memory limit.
template:
src: memory_limit.ini.j2
dest: "/etc/php/{{ php_default_version_debian }}/cli/conf.d/20-memory_limit.ini"
become: true
when: php_set_cli_memory_limit | bool

View File

@ -85,3 +85,4 @@
- include_tasks: configure-apcu.yml
- include_tasks: configure-opcache.yml
- include_tasks: configure-fpm.yml
- include_tasks: configure-cli.yml

View File

@ -0,0 +1,5 @@
; {{ ansible_managed }}
; configuration for increasing PHP CLI memory limit
; priority=20
memory_limit = {{ php_cli_memory_limit }}