diff --git a/Homestead.yaml.example b/Homestead.yaml.example index ef3638def..c1a757adc 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -41,7 +41,7 @@ services: # to: 4040 # - send: 54320 # PostgreSQL # to: 5432 -# - send: 8025 # Mailhog +# - send: 8025 # Mailpit # to: 8025 # - send: 9600 # to: 9600 diff --git a/Vagrantfile b/Vagrantfile index 2d94f5282..2832f8aa9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,7 +15,7 @@ aliasesPath = confDir + "/aliases" require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') -Vagrant.require_version '>= 2.2.4' +Vagrant.require_version '>= 2.4' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if File.exist? aliasesPath then diff --git a/bin/homestead b/bin/homestead index 8448c6c53..1640056a4 100755 --- a/bin/homestead +++ b/bin/homestead @@ -8,7 +8,7 @@ if(is_file( __DIR__.'/../vendor/autoload.php')) { require __DIR__.'/../../../autoload.php'; } -$app = new Symfony\Component\Console\Application('Laravel Homestead', '14.5.0'); +$app = new Symfony\Component\Console\Application('Laravel Homestead', '15.0.0'); $app->add(new Laravel\Homestead\MakeCommand); $app->add(new Laravel\Homestead\WslApplyFeatures); diff --git a/resources/Homestead.yaml b/resources/Homestead.yaml index 82d4b31bf..0e86acc18 100644 --- a/resources/Homestead.yaml +++ b/resources/Homestead.yaml @@ -40,7 +40,7 @@ services: # to: 4040 # - send: 54320 # PostgreSQL # to: 5432 -# - send: 8025 # Mailhog +# - send: 8025 # Mailpit # to: 8025 # - send: 9600 # to: 9600 diff --git a/resources/aliases b/resources/aliases index 702b1af0d..931cfe6bb 100644 --- a/resources/aliases +++ b/resources/aliases @@ -119,7 +119,7 @@ function serve-apache() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/apache.sh - sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -132,7 +132,7 @@ function serve-apache-proxy() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/apache-proxy.sh - sudo bash /vagrant/scripts/site-types/apache-proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/apache-proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -145,7 +145,7 @@ function serve-laravel() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/laravel.sh - sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -158,7 +158,7 @@ function serve-proxy() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/proxy.sh - sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -171,7 +171,7 @@ function serve-silverstripe() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/silverstripe.sh - sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -184,7 +184,7 @@ function serve-spa() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/spa.sh - sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -197,7 +197,7 @@ function serve-statamic() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/statamic.sh - sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -210,7 +210,7 @@ function serve-symfony2() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/symfony2.sh - sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -223,7 +223,7 @@ function serve-symfony4() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/symfony4.sh - sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -236,7 +236,7 @@ function serve-pimcore() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/pimcore.sh - sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " diff --git a/resources/localized/aliases b/resources/localized/aliases index a6dc9d181..cae6cbd24 100644 --- a/resources/localized/aliases +++ b/resources/localized/aliases @@ -106,7 +106,7 @@ function serve-apache() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -119,7 +119,7 @@ function serve-laravel() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -131,7 +131,7 @@ function serve-proxy() { if [[ "$1" && "$2" ]] then sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -144,7 +144,7 @@ function serve-silverstripe() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -157,7 +157,7 @@ function serve-spa() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -170,7 +170,7 @@ function serve-statamic() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -183,7 +183,7 @@ function serve-symfony2() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -196,7 +196,7 @@ function serve-symfony4() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -209,7 +209,7 @@ function serve-pimcore() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " diff --git a/scripts/features/mailpit.sh b/scripts/features/mailpit.sh index fd6973243..e7709f6a3 100644 --- a/scripts/features/mailpit.sh +++ b/scripts/features/mailpit.sh @@ -36,6 +36,6 @@ ExecStart=/usr/bin/env /usr/local/bin/mailpit WantedBy=multi-user.target EOF -systemctl disable --now mailhog +systemctl disable --now mailpit systemctl enable --now mailpit diff --git a/scripts/features/php8.3.sh b/scripts/features/php8.3.sh new file mode 100644 index 000000000..f9267ecb5 --- /dev/null +++ b/scripts/features/php8.3.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +if [ -f ~/.homestead-features/wsl_user_name ]; then + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" +else + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant +fi + +export DEBIAN_FRONTEND=noninteractive + +if [ -f /home/$WSL_USER_NAME/.homestead-features/php83 ] +then + echo "PHP 8.2 already installed." + exit 0 +fi + +touch /home/$WSL_USER_NAME/.homestead-features/php83 +chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features + +# PHP 8.3 +apt-get install -y --allow-change-held-packages \ +php8.3 php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dba php8.3-dev \ +php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-interbase php8.3-intl php8.3-ldap \ +php8.3-mbstring php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline \ +php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-sybase php8.3-tidy php8.3-xml php8.3-xsl \ +php8.3-zip +# php8.3-imagick php8.3-memcached php8.3-redis php8.3-xmlrpc php8.3-xdebug + +# Configure php.ini for CLI +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/cli/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/cli/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/cli/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/cli/php.ini + +# Configure Xdebug +# echo "xdebug.mode = debug" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.discover_client_host = true" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.client_port = 9003" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.max_nesting_level = 512" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "opcache.revalidate_freq = 0" >> /etc/php/8.3/mods-available/opcache.ini + +# Configure php.ini for FPM +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/fpm/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/fpm/php.ini +sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.3/fpm/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/fpm/php.ini +sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/fpm/php.ini + +printf "[openssl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "[curl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini + +# Configure FPM +sed -i "s/user = www-data/user = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/group = www-data/group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.3/fpm/pool.d/www.conf diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 5b1b89810..54cd50882 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'] ||= '>= 13.0.0, < 14.0.0' + config.vm.box_version = settings['version'] ||= '>= 14.0.0, < 15.0.0' end config.vm.hostname = settings['hostname'] ||= 'homestead' @@ -410,7 +410,7 @@ def self.configure(config, settings) site['to'], # $2 site['port'] ||= http_port, # $3 site['ssl'] ||= https_port, # $4 - site['php'] ||= '8.2', # $5 + site['php'] ||= '8.3', # $5 params ||= '', # $6 site['xhgui'] ||= '', # $7 site['exec'] ||= 'false', # $8 @@ -560,6 +560,11 @@ def self.configure(config, settings) s.args = [var['key'], var['value']] end + config.vm.provision 'shell' do |s| + s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php/8.3/fpm/pool.d/www.conf" + s.args = [var['key'], var['value']] + end + config.vm.provision 'shell' do |s| s.inline = "echo \"\n# Set Homestead Environment Variable\nexport $1=$2\" >> /home/vagrant/.profile" s.args = [var['key'], var['value']] @@ -567,7 +572,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; service php8.0-fpm restart; service php8.1-fpm restart; service php8.2-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; service php8.1-fpm restart; service php8.2-fpm restart; service php8.3-fpm restart;' end end