Skip to content

Commit

Permalink
Add support for PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
svpernova09 committed Sep 25, 2019
1 parent df69788 commit 1260e77
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ php7.3-cli php7.3-bcmath php7.3-curl php7.3-dev php7.3-gd php7.3-imap php7.3-int
php7.3-mbstring php7.3-mysql php7.3-odbc php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-soap php7.3-sqlite3 \
php7.3-xml php7.3-zip php7.3-readline php-memcached php-xdebug php-pear php-imagick php-redis

# PHP 7.4
apt-get install -y --allow-change-held-packages \
php7.4-cli php7.4-bcmath php7.4-curl php7.4-dev php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap \
php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-pgsql php7.4-phpdbg php7.4-pspell php7.4-soap php7.4-sqlite3 \
php7.4-xml php7.4-zip php7.4-readline

# PHP 7.2
apt-get install -y --allow-change-held-packages \
php7.2-cli php7.2-bcmath php7.2-curl php7.2-dev php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap \
Expand Down Expand Up @@ -79,13 +85,18 @@ mv composer.phar /usr/local/bin/composer
# Install Laravel Envoy, Installer, and prestissimo for parallel downloads
sudo su vagrant <<'EOF'
/usr/local/bin/composer global require hirak/prestissimo
/usr/local/bin/composer global require "laravel/envoy=~1.0"
/usr/local/bin/composer global require "laravel/installer=~2.0"
/usr/local/bin/composer global require "laravel/lumen-installer=~1.0"
/usr/local/bin/composer global require "laravel/spark-installer=~2.0"
/usr/local/bin/composer global require "laravel/envoy=^1.6"
/usr/local/bin/composer global require "laravel/installer=^2.1"
/usr/local/bin/composer global require "laravel/lumen-installer=^1.1"
/usr/local/bin/composer global require "laravel/spark-installer=dev-master"
EOF

# Set Some PHP CLI Settings
sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/cli/php.ini
sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/cli/php.ini
sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/cli/php.ini
sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/cli/php.ini

sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/cli/php.ini
sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/cli/php.ini
sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/cli/php.ini
Expand Down Expand Up @@ -113,7 +124,7 @@ sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/5.6/cli/php.ini

# Install Nginx & PHP-FPM
apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
nginx php7.1-fpm php7.3-fpm php7.2-fpm php7.0-fpm php5.6-fpm
nginx php7.1-fpm php7.4-fpm php7.3-fpm php7.2-fpm php7.0-fpm php5.6-fpm

rm /etc/nginx/sites-enabled/default
rm /etc/nginx/sites-available/default
Expand All @@ -131,6 +142,12 @@ echo "xdebug.remote_port = 9000" >> /etc/php/7.3/mods-available/xdebug.ini
echo "xdebug.max_nesting_level = 512" >> /etc/php/7.3/mods-available/xdebug.ini
echo "opcache.revalidate_freq = 0" >> /etc/php/7.3/mods-available/opcache.ini

#echo "xdebug.remote_enable = 1" >> /etc/php/7.4/mods-available/xdebug.ini
#echo "xdebug.remote_connect_back = 1" >> /etc/php/7.4/mods-available/xdebug.ini
#echo "xdebug.remote_port = 9000" >> /etc/php/7.4/mods-available/xdebug.ini
#echo "xdebug.max_nesting_level = 512" >> /etc/php/7.4/mods-available/xdebug.ini
echo "opcache.revalidate_freq = 0" >> /etc/php/7.4/mods-available/opcache.ini

echo "xdebug.remote_enable = 1" >> /etc/php/7.2/mods-available/xdebug.ini
echo "xdebug.remote_connect_back = 1" >> /etc/php/7.2/mods-available/xdebug.ini
echo "xdebug.remote_port = 9000" >> /etc/php/7.2/mods-available/xdebug.ini
Expand Down Expand Up @@ -169,6 +186,20 @@ printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php
printf "[curl]\n" | tee -a /etc/php/7.3/fpm/php.ini
printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini

sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/fpm/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/fpm/php.ini
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.4/fpm/php.ini
sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/fpm/php.ini
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.4/fpm/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.4/fpm/php.ini
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/fpm/php.ini

printf "[openssl]\n" | tee -a /etc/php/7.4/fpm/php.ini
printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini

printf "[curl]\n" | tee -a /etc/php/7.4/fpm/php.ini
printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini

sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/fpm/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/fpm/php.ini
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.2/fpm/php.ini
Expand Down Expand Up @@ -262,6 +293,13 @@ sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.3/fpm/pool.d/www.c
sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf
sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.3/fpm/pool.d/www.conf

sed -i "s/user = www-data/user = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf
sed -i "s/group = www-data/group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf

sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf
sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf
sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.4/fpm/pool.d/www.conf

sed -i "s/user = www-data/user = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf
sed -i "s/group = www-data/group = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf

Expand Down Expand Up @@ -292,6 +330,7 @@ sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/5.6/fpm/pool.d/www.conf

service nginx restart
service php7.2-fpm restart
service php7.4-fpm restart
service php7.3-fpm restart
service php7.1-fpm restart
service php7.0-fpm restart
Expand Down

0 comments on commit 1260e77

Please sign in to comment.