Skip to content

Commit 2fddaca

Browse files
committed
PHP Version 7.4.3
1 parent 1d8bc1c commit 2fddaca

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN BUILD_DEPS='software-properties-common' \
1515
&& add-apt-repository -y ppa:ondrej/php \
1616
&& add-apt-repository -y ppa:ondrej/apache2 \
1717
&& apt-get update \
18-
&& apt-get install -y curl apache2 libsasl2-modules libapache2-mod-php7.3 libmcrypt-dev php7.3-cli php7.3-dev php7.3-readline php7.3-mbstring php7.3-zip php7.3-intl php-xml php7.3-xml php7.3-xmlrpc php7.3-json php7.3-curl php7.3-gd php7.3-pgsql php7.3-mysql php-pear \
18+
&& apt-get install -y curl apache2 libsasl2-modules libapache2-mod-php7.4 libmcrypt-dev php7.4-cli php7.4-dev php7.4-readline php7.4-mbstring php7.4-zip php7.4-intl php-xml php7.4-xml php7.4-xmlrpc php7.4-json php7.4-curl php7.4-gd php7.4-pgsql php7.4-mysql php-pear \
1919
&& apt-get update && apt-get install -yq --no-install-recommends \
2020
git \
2121
cron \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Beerpay](https://beerpay.io/htmlgraphic/Apache/badge.svg?style=beer)](https://beerpay.io/htmlgraphic/Apache) [![Beerpay](https://beerpay.io/htmlgraphic/Apache/make-wish.svg?style=flat)](https://beerpay.io/htmlgraphic/Apache)
88

99

10-
This repo will give you a turn key Docker container build for use in **production** OR **dev**. The setup includes an Apache web service, PHP 7.3, PHP Composer, linked [MySQL 5.7.28](https://hub.docker.com/_/mysql) instance and a data container volume.
10+
This repo will give you a turn key Docker container build for use in **production** OR **dev**. The setup includes an Apache web service, PHP Version 7.4.3, PHP Composer, linked [MySQL 5.7.28](https://hub.docker.com/_/mysql) instance and a data container volume.
1111

1212
Using containers offer a huge advantage when developing locally or in prodcution. Use this containers for development and deployment. Changing `NODE_ENVIRONMENT` within to `.env` to `dev` or `production` will offer a dynamic environment.
1313

app/run.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,54 +72,54 @@ fi
7272
# Route mail to SMTP queuing servers
7373
#
7474
#####
75-
if [ ! -f /etc/php/7.3/apache2/build ]; then
75+
if [ ! -f /etc/php/7.4/apache2/build ]; then
7676

7777
# Tweak Apache build
78-
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.3/apache2/php.ini
79-
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.3/apache2/php.ini
78+
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.4/apache2/php.ini
79+
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.4/apache2/php.ini
8080
sed -i 's/IncludeOptional sites-enabled\/\*.conf/IncludeOptional \/data\/apache2\/sites-enabled\/*.conf/' /etc/apache2/apache2.conf
81-
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.3/apache2/php.ini
82-
echo "extension=mcrypt.so" > /etc/php/7.3/apache2/conf.d/mcrypt.ini
81+
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.4/apache2/php.ini
82+
echo "extension=mcrypt.so" > /etc/php/7.4/apache2/conf.d/mcrypt.ini
8383

8484
# Update the PHP.ini file, enable <? ?> tags and quiet logging.
85-
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/7.3/apache2/php.ini
85+
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/7.4/apache2/php.ini
8686

8787
# Sessions & garbage collection
88-
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/7.3/apache2/php.ini
89-
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/7.3/apache2/php.ini
88+
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/7.4/apache2/php.ini
89+
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/7.4/apache2/php.ini
9090

9191
# Update Apache / PHP Config
92-
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.3/apache2/php.ini
93-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.3/apache2/php.ini
94-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.3/apache2/php.ini
95-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.3/apache2/php.ini
96-
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/7.3/apache2/php.ini
92+
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.4/apache2/php.ini
93+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/apache2/php.ini
94+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/apache2/php.ini
95+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/apache2/php.ini
96+
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/7.4/apache2/php.ini
9797

9898
# Update CLI Config
99-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.3/cli/php.ini
100-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.3/cli/php.ini
101-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.3/cli/php.ini
99+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/cli/php.ini
100+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/cli/php.ini
101+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/cli/php.ini
102102

103103

104104
# Add build file to remove duplicate script execution
105-
echo 1 > /etc/php/7.3/apache2/build
105+
echo 1 > /etc/php/7.4/apache2/build
106106

107107
if [[ -z "${NODE_ENVIRONMENT}" ]]; then
108108
# $NODE_ENVIRONMENT is set on container creation
109109
echo " env NODE_ENVIRONMENT is not set, Apache is not configured correctly."
110110
else
111111
if [ "$NODE_ENVIRONMENT" == 'dev' ]; then
112112
# Tweak Apache build
113-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.3/apache2/php.ini
113+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
114114
# Update the PHP.ini file, enable <? ?> tags and quiet logging.
115-
sed -i "s/error_reporting = .*$/error_reporting = E_ALL/" /etc/php/7.3/apache2/php.ini
115+
sed -i "s/error_reporting = .*$/error_reporting = E_ALL/" /etc/php/7.4/apache2/php.ini
116116
fi
117117

118118
if [ "$NODE_ENVIRONMENT" == 'production' ]; then
119119
# Tweak Apache build
120-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.3/apache2/php.ini
120+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
121121
# Update the PHP.ini file, enable <? ?> tags and quiet logging.
122-
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.3/apache2/php.ini
122+
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.4/apache2/php.ini
123123
fi
124124

125125
fi

docker-compose.local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.3'
22
services:
33
web:
4-
image: 'htmlgraphic/apache:latest' # PHP v7.3.2-3+ubuntu18.04.1+deb.sury.org+1
4+
image: 'htmlgraphic/apache:latest'
55
container_name: apache
66
volumes:
77
- '~/SITES/docker:/data' # <- Change to preferred local working dir

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.3'
22
services:
33
web:
4-
image: 'htmlgraphic/apache:envoyer' # PHP v7.3.2-3+ubuntu18.04.1+deb.sury.org+1
4+
image: 'htmlgraphic/apache:envoyer'
55
ports:
66
- "80:80"
77
- "443:443"

tests/build_tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ testCLI_max_input_time()
100100

101101
testApache_max_execution_time()
102102
{
103-
max_execution_time=$(cat /etc/php/7.3/apache2/php.ini | grep 'max_execution_time')
103+
max_execution_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_execution_time')
104104
echo 'Test max_execution_time, currently set to "'$max_execution_time'"'
105105
test=$(echo $max_execution_time | grep 'max_execution_time = 300' | wc -l)
106106
assertEquals 1 $test
@@ -109,7 +109,7 @@ testApache_max_execution_time()
109109

110110
testApache_MemoryLimit()
111111
{
112-
memory_limit=$(cat /etc/php/7.3/apache2/php.ini | grep 'memory_limit')
112+
memory_limit=$(cat /etc/php/7.4/apache2/php.ini | grep 'memory_limit')
113113
echo 'Test memory_limit, currently set to "'$memory_limit'"'
114114
test=$(echo $memory_limit | grep 'memory_limit = -1' | wc -l)
115115
assertEquals 1 $test
@@ -118,7 +118,7 @@ testApache_MemoryLimit()
118118

119119
testApache_upload_max_filesize()
120120
{
121-
upload_max_filesize=$(cat /etc/php/7.3/apache2/php.ini | grep 'upload_max_filesize')
121+
upload_max_filesize=$(cat /etc/php/7.4/apache2/php.ini | grep 'upload_max_filesize')
122122
echo 'Test upload_max_filesize, currently set to "'$upload_max_filesize'"'
123123
test=$(echo $upload_max_filesize | grep 'upload_max_filesize = 1000M' | wc -l)
124124
assertEquals 1 $test
@@ -127,7 +127,7 @@ testApache_upload_max_filesize()
127127

128128
testApache_post_max_size()
129129
{
130-
post_max_size=$(cat /etc/php/7.3/apache2/php.ini | grep 'post_max_size')
130+
post_max_size=$(cat /etc/php/7.4/apache2/php.ini | grep 'post_max_size')
131131
echo 'Test post_max_size, currently set to "'$post_max_size'"'
132132
test=$(echo $post_max_size | grep 'post_max_size = 1000M' | wc -l)
133133
assertEquals 1 $test
@@ -136,7 +136,7 @@ testApache_post_max_size()
136136

137137
testApache_max_input_time()
138138
{
139-
max_input_time=$(cat /etc/php/7.3/apache2/php.ini | grep 'max_input_time')
139+
max_input_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_input_time')
140140
echo 'Test max_input_time, currently set to "'$max_input_time'"'
141141
test=$(echo $max_input_time | grep 'max_input_time = 300' | wc -l)
142142
assertEquals 1 $test

0 commit comments

Comments
 (0)