From ef6facc62920a8b0071677a25e4e1bad9b8ac141 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sat, 10 Oct 2020 10:36:59 -0500 Subject: [PATCH] Install and configure PHP 8 on 18.04 --- scripts/provision.sh | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index ca9ffca0..742af0d9 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -43,11 +43,11 @@ apt-get install -y --allow-change-held-packages \ php-imagick php-memcached php-redis php-xdebug php-dev # PHP 8.0 -#apt-get install -y --allow-change-held-packages \ -#php8.0 php8.0-bcmath php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dba php8.0-dev \ -#php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-interbase php8.0-intl php8.0-json php8.0-ldap \ -#php8.0-mbstring php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-readline \ -#php8.0-snmp php8.0-soap php8.0-sqlite3 php8.0-sybase php8.0-tidy php8.0-xml php8.0-xmlrpc php8.0-xsl php8.0-zip +apt-get install -y --allow-change-held-packages \ +php8.0 php8.0-bcmath php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dba php8.0-dev \ +php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-interbase php8.0-intl php8.0-ldap \ +php8.0-mbstring php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-readline \ +php8.0-snmp php8.0-soap php8.0-sqlite3 php8.0-sybase php8.0-tidy php8.0-xml php8.0-xsl php8.0-zip # PHP 7.4 apt-get install -y --allow-change-held-packages \ @@ -113,10 +113,10 @@ sudo su vagrant <<'EOF' EOF # Set Some PHP CLI Settings -#sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini -#sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini -#sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini -#sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini +sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini +sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini +sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini +sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini 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 @@ -162,11 +162,11 @@ touch /home/vagrant/.config/nginx/nginx.conf sudo ln -sf /home/vagrant/.config/nginx/nginx.conf /etc/nginx/conf.d/nginx.conf # Setup Some PHP-FPM Options -#echo "xdebug.remote_enable = 1" >> /etc/php/8.0/mods-available/xdebug.ini -#echo "xdebug.remote_connect_back = 1" >> /etc/php/8.0/mods-available/xdebug.ini -#echo "xdebug.remote_port = 9000" >> /etc/php/8.0/mods-available/xdebug.ini -#echo "xdebug.max_nesting_level = 512" >> /etc/php/8.0/mods-available/xdebug.ini -#echo "opcache.revalidate_freq = 0" >> /etc/php/8.0/mods-available/opcache.ini +echo "xdebug.remote_enable = 1" >> /etc/php/8.0/mods-available/xdebug.ini +echo "xdebug.remote_connect_back = 1" >> /etc/php/8.0/mods-available/xdebug.ini +echo "xdebug.remote_port = 9000" >> /etc/php/8.0/mods-available/xdebug.ini +echo "xdebug.max_nesting_level = 512" >> /etc/php/8.0/mods-available/xdebug.ini +echo "opcache.revalidate_freq = 0" >> /etc/php/8.0/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 @@ -218,19 +218,19 @@ printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php 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/8.0/fpm/php.ini -#sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini -#sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini -#sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini -#sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini -#sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini -#sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini -# -#printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini -#printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini -# -#printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini -#printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/fpm/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini +sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini +sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini +sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini + +printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini +printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini + +printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini +printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/fpm/php.ini sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/fpm/php.ini @@ -332,12 +332,12 @@ EOF sed -i "s/user www-data;/user vagrant;/" /etc/nginx/nginx.conf sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf -#sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf -#sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf -# -#sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf -#sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf -#sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf + +sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/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 @@ -382,7 +382,7 @@ sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/5.6/fpm/pool.d/www.c sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/5.6/fpm/pool.d/www.conf service nginx restart -#service php8.0-fpm restart +service php8.0-fpm restart service php7.4-fpm restart service php7.3-fpm restart service php7.2-fpm restart