Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/php_ini.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.
15 changes: 14 additions & 1 deletion spec/php_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/redhat/php.ini.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>

Expand Down
Loading