From 6692de0d3c797fe7ef2658e8465f0d19b4be1553 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sat, 10 Oct 2020 10:30:34 -0500 Subject: [PATCH 1/4] Enable PHP 8 --- bin/wsl-init | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/bin/wsl-init b/bin/wsl-init index d344110d3..01855f13b 100644 --- a/bin/wsl-init +++ b/bin/wsl-init @@ -62,11 +62,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 \ @@ -138,10 +138,10 @@ mv composer.phar /usr/local/bin/composer #EOF ## Set Some PHP CLI Settings -#sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini -#sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini -#sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini -#sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/cli/php.ini sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/cli/php.ini @@ -184,7 +184,7 @@ sed -i "s/www-data/$WSL_USER_NAME/" /etc/apache2/envvars #a2enconf php7.2-fpm a2enconf php7.3-fpm a2enconf php7.4-fpm -#a2enconf php8.0-fpm +a2enconf php8.0-fpm # Assume user wants mode_rewrite support sudo a2enmod rewrite @@ -220,11 +220,11 @@ touch /home/$WSL_USER_NAME/.config/nginx/nginx.conf ln -sf /home/$WSL_USER_NAME/.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 @@ -262,19 +262,19 @@ echo "opcache.revalidate_freq = 0" >> /etc/php/7.3/mods-available/opcache.ini #echo "xdebug.max_nesting_level = 512" >> /etc/php/5.6/mods-available/xdebug.ini #echo "opcache.revalidate_freq = 0" >> /etc/php/5.6/mods-available/opcache.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.4/fpm/php.ini sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/fpm/php.ini @@ -364,12 +364,12 @@ printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7. sudo phpdismod -s cli xdebug # Set The Nginx & PHP-FPM User -#sed -i "s/user = www-data/user = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf -#sed -i "s/group = www-data/group = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf -# -#sed -i "s/listen\.owner.*/listen.owner = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf -#sed -i "s/listen\.group.*/listen.group = $WSL_USER_NAME/" /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 = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/group = www-data/group = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf + +sed -i "s/listen\.owner.*/listen.owner = $WSL_USER_NAME/" /etc/php/8.0/fpm/pool.d/www.conf +sed -i "s/listen\.group.*/listen.group = $WSL_USER_NAME/" /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 $WSL_USER_NAME;/" /etc/nginx/nginx.conf sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf @@ -417,7 +417,7 @@ sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.3/fpm/pool.d/www.conf #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 From 2bf1015642d0dda52e01d0f769a2cc89287e2415 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sat, 10 Oct 2020 11:55:08 -0500 Subject: [PATCH 2/4] Updates for php 8.0 --- scripts/features/blackfire.sh | 1 + scripts/features/couchdb.sh | 1 + scripts/homestead.rb | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/features/blackfire.sh b/scripts/features/blackfire.sh index bd4a0f3d6..5dd957bc0 100755 --- a/scripts/features/blackfire.sh +++ b/scripts/features/blackfire.sh @@ -54,4 +54,5 @@ service php7.1-fpm restart service php7.2-fpm restart service php7.3-fpm restart service php7.4-fpm restart +service php8.0-fpm restart service blackfire-agent restart diff --git a/scripts/features/couchdb.sh b/scripts/features/couchdb.sh index dceb38d17..56a027a57 100755 --- a/scripts/features/couchdb.sh +++ b/scripts/features/couchdb.sh @@ -46,3 +46,4 @@ sudo service php7.1-fpm restart sudo service php7.2-fpm restart sudo service php7.3-fpm restart sudo service php7.4-fpm restart +sudo service php8.0-fpm restart diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 58ccc79ea..f1c21a6c7 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -19,7 +19,7 @@ def self.configure(config, settings) config.vm.define settings['name'] ||= 'homestead' config.vm.box = settings['box'] ||= 'laravel/homestead' unless settings.has_key?('SpeakFriendAndEnter') - config.vm.box_version = settings['version'] ||= '~> 10.0' + config.vm.box_version = settings['version'] ||= '~> 10.1.1' end config.vm.hostname = settings['hostname'] ||= 'homestead' @@ -501,7 +501,7 @@ def self.configure(config, settings) end config.vm.provision 'shell' do |s| - s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart;' + s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart; service php8.0-fpm restart;' end end From 0c9d7fc58051c0cdadb515a4c63006c4a00a9d2f Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Tue, 20 Oct 2020 16:55:00 -0500 Subject: [PATCH 3/4] Only create databases when enabled --- scripts/homestead.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 403bf2648..e4c205beb 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -534,16 +534,20 @@ def self.configure(config, settings) end settings['databases'].each do |db| - config.vm.provision 'shell' do |s| - s.name = 'Creating MySQL Database: ' + db - s.path = script_dir + '/create-mysql.sh' - s.args = [db] + if enabled_databases.include? 'mysql' + config.vm.provision 'shell' do |s| + s.name = 'Creating MySQL Database: ' + db + s.path = script_dir + '/create-mysql.sh' + s.args = [db] + end end - config.vm.provision 'shell' do |s| - s.name = 'Creating Postgres Database: ' + db - s.path = script_dir + '/create-postgres.sh' - s.args = [db] + if enabled_databases.include? 'postgresql' + config.vm.provision 'shell' do |s| + s.name = 'Creating Postgres Database: ' + db + s.path = script_dir + '/create-postgres.sh' + s.args = [db] + end end if enabled_databases.include? 'mongodb' From bbd95398e011490d1e47168b767150d8bbc760a9 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 23 Oct 2020 18:44:22 -0500 Subject: [PATCH 4/4] Use primary TimescaleDB package --- scripts/features/timescaledb.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/features/timescaledb.sh b/scripts/features/timescaledb.sh index a097ba7ba..2cc645f33 100755 --- a/scripts/features/timescaledb.sh +++ b/scripts/features/timescaledb.sh @@ -24,12 +24,12 @@ sudo apt-get update # Now install appropriate package for PG version if [ -f ~/.homestead-features/wsl_user_name ]; then - sudo apt-get -y install timescaledb-oss-postgresql-12 + sudo apt-get -y install timescaledb-postgresql-12 else - sudo apt-get -y install timescaledb-oss-postgresql-9.6 - sudo apt-get -y install timescaledb-oss-postgresql-10 - sudo apt-get -y install timescaledb-oss-postgresql-11 - sudo apt-get -y install timescaledb-oss-postgresql-12 + sudo apt-get -y install timescaledb-postgresql-9.6 + sudo apt-get -y install timescaledb-postgresql-10 + sudo apt-get -y install timescaledb-postgresql-11 + sudo apt-get -y install timescaledb-postgresql-12 fi sudo timescaledb-tune --quiet --yes