php_ini

May 23, 2024 ยท View on GitHub

Adds a php.ini to the appropriate location.

Actions

  • :add: Add a php.ini file (default)
  • :remove: Remove a php.ini file

Properties

NameTypeDefaultDescription
conf_dirStringPlatform-specific - see libraries/helpers.rbDirectory to place the php.ini file under
ini_templateStringphp.ini.erb (see templates/<distro>/php.ini.rb)Template to use to create the php.ini file
ini_cookbookStringphp (this cookbook)Cookbook where the template is located
directivesHash{}Directive-value pairs to add to the php.ini file
ext_dirStringPlatform-specific - see libraries/helpers.rbDirectory in which the loadable extensions (modules) reside

Examples

Add a php.ini file to the default location for your platform

php_ini 'ini' do
  action :add
end

Add a php.ini file to the /etc/php-fpm.d directory

php_ini 'fpm.d' do
  conf_dir '/etc/php-fpm.d'
  action :add
end

Remove a php.ini file from the /etc/php-fpm.d directory

php_ini 'fpm.d' do
  conf_dir '/etc/php-fpm.d'
  action :remove
end