Skip to content

Commit

Permalink
correct path to 7.3 config
Browse files Browse the repository at this point in the history
  • Loading branch information
gegere committed Mar 10, 2019
1 parent 2d7525f commit 098bbd5
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions app/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,46 +73,46 @@ fi
# Route mail to SMTP queuing servers
#
#####
if [ ! -f /etc/php/7.0/apache2/build ]; then
if [ ! -f /etc/php/7.3/apache2/build ]; then

# Tweak Apache build
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.0/apache2/php.ini
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.0/apache2/php.ini
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.3/apache2/php.ini
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.3/apache2/php.ini
sed -i 's/IncludeOptional sites-enabled\/\*.conf/IncludeOptional \/data\/apache2\/sites-enabled\/*.conf/' /etc/apache2/apache2.conf
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.0/apache2/php.ini
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.3/apache2/php.ini

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

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

# Increase memory & upload limitations
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.0/apache2/php.ini
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.0/apache2/php.ini
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.0/apache2/php.ini
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.0/apache2/php.ini
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.3/apache2/php.ini
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.3/apache2/php.ini
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.3/apache2/php.ini
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.3/apache2/php.ini

# Add build file to remove duplicate script execution
echo 1 > /etc/php/7.0/apache2/build
echo 1 > /etc/php/7.3/apache2/build

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

if [ "$NODE_ENVIRONMENT" == 'production' ]; then
# Tweak Apache build
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.0/apache2/php.ini
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
# Update the PHP.ini file, enable <? ?> tags and quiet logging.
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.3/apache2/php.ini
fi

fi
Expand Down

0 comments on commit 098bbd5

Please sign in to comment.