Skip to content
Browse files

turn off gc for ubuntu

  • Loading branch information...
1 parent e7937dc commit 987d2e0ad7976c393a4ab8b7c57d0339d1769197 @phunehehe committed
Showing with 36 additions and 34 deletions.
  1. +35 −33 php/attributes/default.rb
  2. +1 −1 php/templates/default/php.ini.erb
View
68 php/attributes/default.rb
@@ -20,32 +20,42 @@
lib_dir = kernel['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
-default['php']['install_method'] = 'package'
+default[:php][:install_method] = 'package'
+default[:php][:post_max_size] = "8M"
+default[:php][:timezone] = 'UTC'
+default[:php][:upload_max_filesize] = "2M"
+
+default[:php][:fpm][:pm] = 'ondemand'
+default[:php][:fpm][:process][:max] = 10
+default[:php][:fpm][:catch_workers_output] = 'yes'
+
+default[:php][:session][:gc_probability] = 1
-case node["platform"]
-when "centos", "redhat", "fedora", "amazon"
- default['php']['conf_dir'] = '/etc'
- default['php']['ext_conf_dir'] = '/etc/php.d'
- default[:php][:fpm][:user] = 'nobody'
- default[:php][:fpm][:group] = 'nobody'
- default['php']['ext_dir'] = "/usr/#{lib_dir}/php/modules"
- default['php']['fpm_packages'] = %w{ php-fpm php-cli }
- default['php']['fpm_service'] = 'php-fpm'
- default['php']['fpm_config'] = '/etc/php-fpm.conf'
- default['php']['fpm_pool_config'] = '/etc/php-fpm.d/www.conf'
- default['php']['fpm_config_template'] = 'redhat-php-fpm.conf.erb'
- default[:php][:fpm][:slowlog] = '/var/log/php-fpm/www-slow.log'
-when "debian", "ubuntu"
- default['php']['conf_dir'] = '/etc/php5/fpm'
- default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
- default[:php][:fpm][:user] = 'www-data'
- default[:php][:fpm][:group] = 'www-data'
- default['php']['fpm_packages'] = %w{ php5-fpm php5-cli }
- default['php']['fpm_service'] = 'php5-fpm'
- default['php']['fpm_config'] = '/etc/php5/fpm/php-fpm.conf'
- default['php']['fpm_pool_config'] = '/etc/php5/fpm/pool.d/www.conf'
- default['php']['fpm_config_template'] = 'ubuntu-php-fpm.conf.erb'
- default[:php][:fpm][:slowlog] = '/var/log/php5-fpm.log.slow'
+case node['platform']
+when 'centos', 'redhat', 'fedora', 'amazon'
+ default[:php][:conf_dir] = '/etc'
+ default[:php][:ext_conf_dir] = '/etc/php.d'
+ default[:php][:ext_dir] = "/usr/#{lib_dir}/php/modules"
+ default[:php][:fpm][:group] = 'nobody'
+ default[:php][:fpm][:slowlog] = '/var/log/php-fpm/www-slow.log'
+ default[:php][:fpm][:user] = 'nobody'
+ default[:php][:fpm_config] = '/etc/php-fpm.conf'
+ default[:php][:fpm_config_template] = 'redhat-php-fpm.conf.erb'
+ default[:php][:fpm_packages] = %w{ php-fpm php-cli }
+ default[:php][:fpm_pool_config] = '/etc/php-fpm.d/www.conf'
+ default[:php][:fpm_service] = 'php-fpm'
+when 'debian', 'ubuntu'
+ default[:php][:conf_dir] = '/etc/php5/fpm'
+ default[:php][:ext_conf_dir] = '/etc/php5/conf.d'
+ default[:php][:fpm][:group] = 'www-data'
+ default[:php][:fpm][:slowlog] = '/var/log/php5-fpm.log.slow'
+ default[:php][:fpm][:user] = 'www-data'
+ default[:php][:fpm_config] = '/etc/php5/fpm/php-fpm.conf'
+ default[:php][:fpm_config_template] = 'ubuntu-php-fpm.conf.erb'
+ default[:php][:fpm_packages] = %w{ php5-fpm php5-cli }
+ default[:php][:fpm_pool_config] = '/etc/php5/fpm/pool.d/www.conf'
+ default[:php][:fpm_service] = 'php5-fpm'
+ default[:php][:session][:gc_probability] = 0
end
default['php']['url'] = 'http://us.php.net/distributions'
@@ -90,11 +100,3 @@
--with-sqlite3
--with-pdo-mysql
--with-pdo-sqlite}
-
-default[:php][:post_max_size] = "8M"
-default[:php][:upload_max_filesize] = "2M"
-default[:php][:timezone] = 'UTC'
-
-default[:php][:fpm][:pm] = 'ondemand'
-default[:php][:fpm][:process][:max] = 10
-default[:php][:fpm][:catch_workers_output] = 'yes'
View
2 php/templates/default/php.ini.erb
@@ -117,7 +117,7 @@ session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
-session.gc_probability = 1
+session.gc_probability = <%= node[:php][:session][:gc_probability] %>
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off

0 comments on commit 987d2e0

Please sign in to comment.
Something went wrong with that request. Please try again.