diff --git a/documentation/php_ini.md b/documentation/php_ini.md index 743f06b9..df5cef4a 100644 --- a/documentation/php_ini.md +++ b/documentation/php_ini.md @@ -2,7 +2,7 @@ Adds a `php.ini` to the appropriate location. -On CentOS 7, 8, 9 and 10 and Red Hat Enterprise Linux 8, 9 and 10, the bundled templates set `request_order` to `GP`, matching the verified default PHP packages. Cookies are excluded from `$_REQUEST`; use the `directives` property to set a different value. Other versions retain their previous behaviour. +On CentOS and Red Hat Enterprise Linux 7, 8, 9 and 10, the bundled templates set `request_order` to `GP`, matching the verified default PHP packages. Cookies are excluded from `$_REQUEST`; use the `directives` property to set a different value. Other versions retain their previous behaviour. ## Actions diff --git a/migration.md b/migration.md index cf0c0619..c81c514c 100644 --- a/migration.md +++ b/migration.md @@ -5,7 +5,7 @@ The cookbook already exposes its PHP installation and configuration through cust configuration, and `php_fpm_pool`, `php_pear` and `php_pear_channel` for their respective services. See the [test recipes](test/cookbooks/test/recipes/) for examples. -For CentOS 7–10 and Red Hat Enterprise Linux 8–10, the default generated `php.ini` now sets +For CentOS 7–10 and Red Hat Enterprise Linux 7–10, the default generated `php.ini` now sets `request_order` to `GP`, matching verified distribution packages. This excludes cookies from `$_REQUEST`. Applications that depend on cookies in `$_REQUEST` can explicitly retain them: @@ -17,5 +17,3 @@ end The same `directives` property is available on `php_install` and `php_fpm_pool` when they manage their PHP configuration. Caller-provided directives take precedence over template defaults. -Red Hat Enterprise Linux 7 retains the previous behaviour because its vendor package default was -not independently verified. diff --git a/spec/php_ini_spec.rb b/spec/php_ini_spec.rb index 18d9f875..d48157f1 100644 --- a/spec/php_ini_spec.rb +++ b/spec/php_ini_spec.rb @@ -39,7 +39,20 @@ end end - it { is_expected.not_to render_file('/etc/php.ini').with_content(/^request_order\s*=/) } + it { is_expected.to render_file('/etc/php.ini').with_content(/^request_order = "GP"$/) } + end + + context 'on Red Hat 7 with an override' do + platform 'redhat', '7' + + recipe do + php_ini 'default' do + conf_dir '/etc' + directives 'request_order' => 'GPC' + end + end + + it { is_expected.to render_file('/etc/php.ini').with_content(/^request_order = "GP"$.*^request_order=GPC$/m) } end context 'on CentOS 7' do diff --git a/templates/redhat/php.ini.erb b/templates/redhat/php.ini.erb index 8b590843..eea64bfd 100644 --- a/templates/redhat/php.ini.erb +++ b/templates/redhat/php.ini.erb @@ -444,7 +444,7 @@ track_errors = Off ; referred to as EGPCS or GPC). Registration is done from left to right, newer ; values override older values. variables_order = "EGPCS" -<% if [8, 9, 10].include?(node['platform_version'].to_i) -%> +<% if [7, 8, 9, 10].include?(node['platform_version'].to_i) -%> request_order = "GP" <% end -%>