Skip to content

Commit bb7be16

Browse files
authored
Merge pull request #1033 from seth-reeser/develop-catapult
RedHat: Add PHP 7.3 support.
2 parents 9149a77 + 15cf91f commit bb7be16

File tree

6 files changed

+111
-7
lines changed

6 files changed

+111
-7
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ SilverStripe 3 | `silverstripe3` | 5.3.3 | 5.4 | June
179179
SuiteCRM 7 | `suitecrm7` | 5.5 | 7.1 | October 21, 2013 | [November 15, 2019](http://support.sugarcrm.com/Resources/Supported_Versions/)
180180
WordPress 4 | `wordpress4` | 5.2 | 7.1 | September 4, 2014 |
181181
WordPress 5 | `wordpress5` | 5.6 | 7.2 | December 6, 2018 |
182-
WordPress 6 | `wordpress6` | 5.6 | 7.2 | May 24, 2022 |
182+
WordPress 6 | `wordpress6` | 5.6 | 7.3 | May 24, 2022 |
183183
XenForo 1 | `xenforo1` | 5.2.11 | 5.4 | March 8, 2011 | [December 31, 2019](https://xenforo.com/community/threads/xenforo-1-5-end-of-life-schedule.157679/)
184184
XenForo 2 | `xenforo2` | 5.4.0 | 7.1 | November 28, 2017 |
185185
Zend Framework 2 | `zendframework2` | 5.3.23 | 5.4 | September 5, 2012 |
@@ -196,8 +196,9 @@ Catapult maintains a high level of integrity when it comes to PHP versions, thro
196196
PHP Version | End-of-Life | Maintainer | Updater
197197
------------|-------------|------------|--------
198198
5.4 | June 30, 2024 | [CentOS](https://wiki.centos.org/FAQ/General#head-fe8a0be91ee3e7dea812e8694491e1dde5b75e6d) | [Red Hat](https://access.redhat.com/security/updates/backporting)
199-
7.1 | December 1, 2019 | [SCLO](https://www.softwarecollections.org/en/scls/rhscl/rh-php71/) | [Red Hat](https://access.redhat.com/support/policy/updates/rhscl-rhel7)
200-
7.2 | November 30, 2020 | [SCLO](https://www.softwarecollections.org/en/scls/rhscl/rh-php72/) | [Red Hat](https://access.redhat.com/support/policy/updates/rhscl-rhel7)
199+
7.1 | December 1, 2019 | [Software Collections](https://www.softwarecollections.org/en/scls/rhscl/rh-php71/) | [Red Hat](https://access.redhat.com/support/policy/updates/rhscl-rhel7)
200+
7.2 | November 30, 2020 | [Software Collections](https://www.softwarecollections.org/en/scls/rhscl/rh-php72/) | [Red Hat](https://access.redhat.com/support/policy/updates/rhscl-rhel7)
201+
7.3 | June 30, 2024 | [Jan Staněk](https://www.softwarecollections.org/en/scls/jstanek/rh-php73/) | [Red Hat](https://access.redhat.com/support/policy/updates/rhscl-rhel7)
201202

202203
### End-of-Life (EOL) ###
203204

VERSION.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: 4.4.1
2+
version: 4.5.0
33
major:
44
description: "Catapult uses Semantic Versioning. During a MAJOR increment, incompatable API changes are made which require a manual upgrade path. Please follow these directions:"
55
notice: "NEW MAJOR VERSION OF CATAPULT AVAILABLE"

provisioners/provisioners.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ software:
347347
database_config_file: "wp-config.php"
348348
file_store_containers: ["wp-content"]
349349
file_stores: ["wp-content/languages","wp-content/uploads"]
350-
php_version: "7.2"
350+
php_version: "7.3"
351351
version: [6]
352352
xenforo1:
353353
repo: PRIVATE

provisioners/redhat/modules/apache_vhosts.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ while IFS='' read -r -d '' key; do
173173
force_https_hsts="# HSTS is only enabled when force_https=true"
174174
fi
175175
# handle the software php_version setting
176-
if [ "${software_php_version}" = "7.2" ]; then
176+
if [ "${software_php_version}" = "7.3" ]; then
177+
software_php_version_value="
178+
<FilesMatch \.php$>
179+
SetHandler \"proxy:fcgi://127.0.0.1:9730\"
180+
</FilesMatch>
181+
"
182+
elif [ "${software_php_version}" = "7.2" ]; then
177183
software_php_version_value="
178184
<FilesMatch \.php$>
179185
SetHandler \"proxy:fcgi://127.0.0.1:9720\"

provisioners/redhat/modules/php.sh

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,66 @@ source "/catapult/provisioners/redhat/modules/catapult.sh"
66
sudo yum remove -y *php56*
77
sudo yum remove -y *php70*
88

9+
#################
10+
# PHP 7.3 PHP_FPM
11+
# /etc/opt/rh/rh-php73/php.ini
12+
# /opt/rh/rh-php73/root/usr/bin/php
13+
# /var/opt/rh/rh-php73/log/php-fpm
14+
# sudo yum list \*-php73-\*
15+
#################
16+
17+
# core extensions
18+
sudo yum install -y rh-php73
19+
# These are not actual extensions. They are part of the PHP core and cannot be left out of a PHP binary with compilation options.
20+
21+
# configure php-fpm
22+
if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
23+
sudo yum install -y rh-php73-php-fpm
24+
sed -i -e "s#^listen = 127.0.0.1:9000#listen = 127.0.0.1:9730#g" /etc/opt/rh/rh-php73/php-fpm.d/www.conf
25+
sudo systemctl enable rh-php73-php-fpm
26+
sudo systemctl start rh-php73-php-fpm
27+
fi
28+
29+
# php.ini configuration options
30+
# set the timezone
31+
sed -i -e "s#\;date\.timezone.*#date.timezone = \"$(catapult company.timezone_redhat)\"#g" /etc/opt/rh/rh-php73/php.ini
32+
# increase the post_max_size
33+
sed -i -e "s#^post_max_size.*#post_max_size = 64M#g" /etc/opt/rh/rh-php73/php.ini
34+
# increase the upload_max_filesize
35+
sed -i -e "s#^upload_max_filesize.*#upload_max_filesize = 16M#g" /etc/opt/rh/rh-php73/php.ini
36+
# hide x-powered-by
37+
sed -i -e "s#^expose_php.*#expose_php = Off#g" /etc/opt/rh/rh-php73/php.ini
38+
# increase php memory limit for tools like composer
39+
sed -i -e "s#^memory_limit.*#memory_limit = 256M#g" /etc/opt/rh/rh-php73/php.ini
40+
# display errors on screen using the default recommendations for development and production
41+
if ([ "$1" = "dev" ] || [ "$1" = "test" ]); then
42+
sed -i -e "s#^display_errors.*#display_errors = On#g" /etc/opt/rh/rh-php73/php.ini
43+
sed -i -e "s#^error_reporting.*#error_reporting = E_ALL#g" /etc/opt/rh/rh-php73/php.ini
44+
else
45+
sed -i -e "s#^display_errors.*#display_errors = Off#g" /etc/opt/rh/rh-php73/php.ini
46+
sed -i -e "s#^error_reporting.*#error_reporting = E_ALL \& \~E_DEPRECATED \& \~E_STRICT#g" /etc/opt/rh/rh-php73/php.ini
47+
fi
48+
49+
# bundled extensions
50+
# These extensions are bundled with PHP.
51+
sudo yum install -y rh-php73-php-bcmath rh-php73-php-gd rh-php73-php-intl rh-php73-php-mbstring rh-php73-php-opcache rh-php73-php-soap rh-php73-php-xmlrpc
52+
# disable opcache for dev
53+
if [ "$1" = "dev" ]; then
54+
sudo bash -c 'echo "/var/www" > /etc/opt/rh/rh-php73/php.d/opcache-default.blacklist'
55+
else
56+
sudo bash -c 'echo "" > /etc/opt/rh/rh-php73/php.d/opcache-default.blacklist'
57+
fi
58+
59+
# external extensions
60+
# These extensions are bundled with PHP but in order to compile them, external libraries will be needed.
61+
sudo yum install -y rh-php73-php-gmp rh-php73-php-mysqlnd
62+
63+
# pecl extensions
64+
# https://blog.remirepo.net/post/2017/02/23/Additional-PHP-packages-for-RHSCL
65+
curl --output /etc/yum.repos.d/rhscl-centos-release-scl-epel-7.repo wget https://copr.fedorainfracloud.org/coprs/rhscl/centos-release-scl/repo/epel-7/rhscl-centos-release-scl-epel-7.repo
66+
# These extensions are available from » PECL. They may require external libraries. More PECL extensions exist but they are not documented in the PHP manual yet.
67+
sudo yum install -y sclo-php73-php-pecl-imagick sclo-php73-php-pecl-uploadprogress
68+
969
#################
1070
# PHP 7.2 PHP_FPM
1171
# /etc/opt/rh/rh-php72/php.ini
@@ -243,6 +303,10 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
243303
sed --in-place --expression "s#newrelic\.appname.*#newrelic.appname = \"$(catapult company.name | tr '[:upper:]' '[:lower:]')-${1}-redhat\"#g" "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/scripts/newrelic.ini.template"
244304
sed --in-place --expression "s#;newrelic\.daemon.\port.*#newrelic.daemon.port = \"@newrelic-daemon\"#g" "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/scripts/newrelic.ini.template"
245305
sed --in-place --expression "s/\"REPLACE_WITH_REAL_KEY\"/\"$(catapult company.newrelic_license_key)\"/g" "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/scripts/newrelic.ini.template"
306+
# rh-php73
307+
rm --force "/opt/rh/rh-php73/root/usr/lib64/php/modules/newrelic.so"
308+
cp "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/agent/x64/newrelic-20170718.so" "/opt/rh/rh-php73/root/usr/lib64/php/modules/newrelic.so"
309+
cp "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/scripts/newrelic.ini.template" "/etc/opt/rh/rh-php73/php.d/newrelic.ini"
246310
# rh-php72
247311
rm --force "/opt/rh/rh-php72/root/usr/lib64/php/modules/newrelic.so"
248312
cp "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/agent/x64/newrelic-20170718.so" "/opt/rh/rh-php72/root/usr/lib64/php/modules/newrelic.so"
@@ -253,7 +317,7 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
253317
cp "/usr/share/newrelic/newrelic-php5-8.4.0.231-linux/scripts/newrelic.ini.template" "/etc/opt/rh/rh-php71/php.d/newrelic.ini"
254318

255319
# new relic apm php installed but we need to set configuration
256-
NR_INSTALL_PHPLIST="/usr/bin:/opt/rh/rh-php71/root/usr/bin:/opt/rh/rh-php72/root/usr/bin"; export NR_INSTALL_PHPLIST
320+
NR_INSTALL_PHPLIST="/usr/bin:/opt/rh/rh-php71/root/usr/bin:/opt/rh/rh-php72/root/usr/bin:/opt/rh/rh-php73/root/usr/bin"; export NR_INSTALL_PHPLIST
257321
NR_INSTALL_SILENT="true"; export NR_INSTALL_SILENT
258322
NR_INSTALL_KEY="$(catapult company.newrelic_license_key)"; export NR_INSTALL_KEY
259323
/usr/bin/newrelic-install install
@@ -262,6 +326,7 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
262326
if [ -S /tmp/.newrelic.sock ]; then
263327
sudo rm -f /tmp/.newrelic.sock
264328
/etc/init.d/newrelic-daemon restart
329+
sudo systemctl restart rh-php73-php-fpm
265330
sudo systemctl restart rh-php72-php-fpm
266331
sudo systemctl restart rh-php71-php-fpm
267332
sudo systemctl restart php-fpm
@@ -279,6 +344,7 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
279344
# cat /var/log/httpd/error_log* | grep Max
280345

281346
# look for php-fpm max errors
347+
# cat /var/opt/rh/rh-php73/log/php-fpm/error.log* | grep max
282348
# cat /var/opt/rh/rh-php72/log/php-fpm/error.log* | grep max
283349
# cat /var/opt/rh/rh-php71/log/php-fpm/error.log* | grep max
284350
# cat /var/log/php-fpm/error.log* | grep max
@@ -324,14 +390,20 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
324390
# calculate configuration based on above values
325391
# /catapult/provisioners/redhat/installers/php/configuration-calculator.xlsx
326392

393+
sed -i -e "s#^pm.max_children.*#pm.max_children = 300#g" /etc/opt/rh/rh-php73/php-fpm.d/www.conf
327394
sed -i -e "s#^pm.max_children.*#pm.max_children = 300#g" /etc/opt/rh/rh-php72/php-fpm.d/www.conf
328395
sed -i -e "s#^pm.max_children.*#pm.max_children = 300#g" /etc/opt/rh/rh-php71/php-fpm.d/www.conf
329396
sed -i -e "s#^pm.max_children.*#pm.max_children = 300#g" /etc/php-fpm.d/www.conf
330397

398+
sed -i -e "s#.*pm.max_requests.*#pm.max_requests = 500#g" /etc/opt/rh/rh-php73/php-fpm.d/www.conf
331399
sed -i -e "s#.*pm.max_requests.*#pm.max_requests = 500#g" /etc/opt/rh/rh-php72/php-fpm.d/www.conf
332400
sed -i -e "s#.*pm.max_requests.*#pm.max_requests = 500#g" /etc/opt/rh/rh-php71/php-fpm.d/www.conf
333401
sed -i -e "s#.*pm.max_requests.*#pm.max_requests = 500#g" /etc/php-fpm.d/www.conf
334402

403+
echo -e "\n> php 7.3 configuration"
404+
/opt/rh/rh-php73/root/usr/bin/php --version
405+
/opt/rh/rh-php73/root/usr/bin/php --modules
406+
335407
echo -e "\n> php 7.2 configuration"
336408
/opt/rh/rh-php72/root/usr/bin/php --version
337409
/opt/rh/rh-php72/root/usr/bin/php --modules
@@ -345,6 +417,7 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
345417
/usr/bin/php --modules
346418

347419
# reload php-fpm for configuration changes to take effect
420+
sudo systemctl reload rh-php73-php-fpm
348421
sudo systemctl reload rh-php72-php-fpm
349422
sudo systemctl reload rh-php71-php-fpm
350423
sudo systemctl reload php-fpm
@@ -355,6 +428,7 @@ if ([ "${4}" == "apache" ] || [ "${4}" == "apache-node" ]); then
355428
# cat /var/log/httpd/error_log
356429
# [Tue Dec 26 21:06:23.816950 2017] [mpm_prefork:notice] [pid 792] AH00171: Graceful restart requested, doing restart
357430
# [Tue Dec 26 21:06:24.648573 2017] [core:notice] [pid 792] AH00060: seg fault or similar nasty error detected in the parent process
431+
sudo systemctl start rh-php73-php-fpm
358432
sudo systemctl start rh-php72-php-fpm
359433
sudo systemctl start rh-php71-php-fpm
360434
sudo systemctl start php-fpm

provisioners/redhat/modules/software_tools.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ source ~/.bashrc
4242
composer-php72 --version
4343

4444

45+
echo "> configuring composer-php73"
46+
# configure php version
47+
if ! grep -q "alias composer-php73='/opt/rh/rh-php73/root/usr/bin/php /usr/local/src/composer/composer.phar'" ~/.bashrc; then
48+
sudo bash -c "echo -e \"\nalias composer-php73='/opt/rh/rh-php73/root/usr/bin/php /usr/local/src/composer/composer.phar'\" >> ~/.bashrc"
49+
fi
50+
# expose the alternate software tool version aliases
51+
shopt -s expand_aliases
52+
source ~/.bashrc
53+
# output the version
54+
composer-php73 --version
55+
56+
4557
echo "> configuring drush"
4658
if [ ! -f /usr/bin/drush ]; then
4759
mkdir --parents /usr/local/src/drush
@@ -117,3 +129,14 @@ shopt -s expand_aliases
117129
source ~/.bashrc
118130
# output the version
119131
wp-cli-php72 --allow-root cli version
132+
133+
134+
echo "> configuring wp-cli-php73"
135+
if ! grep -q "alias wp-cli-php73='/opt/rh/rh-php73/root/usr/bin/php /usr/local/src/wp-cli/wp-cli.phar'" ~/.bashrc; then
136+
sudo bash -c "echo -e \"\nalias wp-cli-php73='/opt/rh/rh-php73/root/usr/bin/php /usr/local/src/wp-cli/wp-cli.phar'\" >> ~/.bashrc"
137+
fi
138+
# expose the alternate software tool version aliases
139+
shopt -s expand_aliases
140+
source ~/.bashrc
141+
# output the version
142+
wp-cli-php73 --allow-root cli version

0 commit comments

Comments
 (0)