Skip to content

Commit 77255d6

Browse files
authored
Merge pull request #2333 from polatsinan/fix_mod_php_8
Fix RedHat + PHP 8 libphp file
2 parents 9b02f7e + a2c891e commit 77255d6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

manifests/mod/php.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
$_php_version_no_dot = regsubst($php_version, '\.', '')
9494
if $apache::version::scl_httpd_version {
9595
$_lib = "librh-php${_php_version_no_dot}-php${_php_major}.so"
96-
} elsif ($facts['os']['family'] == 'RedHat') and ($_php_major == 8) {
96+
} elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($php_version, '8') >= 0) {
9797
# RedHat + PHP 8 drop the major version in apache module name.
9898
$_lib = "${libphp_prefix}.so"
9999
} else {

spec/classes/mod/php_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
elsif facts[:os]['release']['major'].to_i == 8
112112
it { is_expected.to contain_apache__mod('php7') }
113113
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") }
114+
115+
context 'with php8.0' do
116+
let :params do
117+
{ php_version: '8.0' }
118+
end
119+
120+
it { is_expected.to contain_apache__mod('php') }
121+
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module modules/libphp.so\n") }
122+
end
114123
elsif facts[:os]['release']['major'].to_i >= 9
115124
it { is_expected.to contain_apache__mod('php') }
116125
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module modules/libphp.so\n") }

0 commit comments

Comments
 (0)