From 7b7e3bb4f498b2943faa1819563fd962ef867029 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 23 Jul 2015 17:44:19 +0200 Subject: [PATCH] APC OK pour PHP 5.4 --- defaults/main.yml | 14 +++++++++++--- tasks/php54max.yml | 8 ++++++++ templates/etc/php5/mods-available/apc.j2 | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7cb96d9..5e294ab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,10 +24,18 @@ php_opcache_revalidate_freq: "2" php_opcache_max_file_size: "0" # APC settings (useful for PHP <5.5). -php_apc_cache_by_default: "1" -php_apc_shm_size: "96M" -php_apc_stat: "1" +php_apc_enable: "1" php_apc_enable_cli: "0" +php_apc_shm_size: "32M" +php_apc_num_files_hint: "0" +php_apc_user_entries_hint: "0" +php_apc_user_ttl: "360" +php_apc_ttl: "60" +php_apc_file_update_protection: "0" +php_apc_slam_defense: "0" +php_apc_stat_ctime: "1" + + # PHP-FPM php_fpm_poold: diff --git a/tasks/php54max.yml b/tasks/php54max.yml index e69de29..b16c758 100644 --- a/tasks/php54max.yml +++ b/tasks/php54max.yml @@ -0,0 +1,8 @@ +--- + +- name: APT | Install php-apcu + apt: pkg=php-apc state=latest + +- name: TEMPLATE | Configure APC + template: src=etc/php5/mods-available/apc.j2 dest=/etc/php5/mods-available/apc.ini + notify: restart php-fpm diff --git a/templates/etc/php5/mods-available/apc.j2 b/templates/etc/php5/mods-available/apc.j2 index e69de29..f223388 100644 --- a/templates/etc/php5/mods-available/apc.j2 +++ b/templates/etc/php5/mods-available/apc.j2 @@ -0,0 +1,16 @@ +; +; {{ ansible_managed }} +; + +extension=apc.so + +apc.enable_cli={{ php_apc_enable_cli }} +apc.shm_size={{ php_apc_shm_size }} +apc.enable={{ php_apc_enable }} +apc.num_files_hint={{ php_apc_num_files_hint }} +apc.user_entries_hint={{ php_apc_user_entries_hint }} +apc.user_ttl={{ php_apc_user_ttl }} +apc.ttl={{ php_apc_ttl }} +apc.file_update_protection={{ php_apc_file_update_protection }} +apc.slam_defense={{ php_apc_slam_defense }} +apc.stat_ctime={{ php_apc_stat_ctime }}