From f8ccc21df591067cabc0c5619fef773d00383ab3 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Mon, 16 Oct 2017 17:20:35 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E2=9D=84=EF=B8=8F=20=F0=9F=92=8E?= =?UTF-8?q?=20=F0=9F=94=96=20Add=20support=20for=20PHP=207.2,=20Tag=20rele?= =?UTF-8?q?ase=206.4.0=20(#691)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/homestead | 2 +- resources/aliases | 4 ++++ resources/localized/aliases | 4 ++++ scripts/blackfire.sh | 1 + scripts/homestead.rb | 11 ++++++++--- scripts/install-couch.sh | 1 + scripts/install-mongo.sh | 11 +++++++++++ scripts/serve-silverstripe.sh | 2 +- 8 files changed, 31 insertions(+), 5 deletions(-) diff --git a/bin/homestead b/bin/homestead index 559da2433..67a2ae62f 100755 --- a/bin/homestead +++ b/bin/homestead @@ -3,7 +3,7 @@ require __DIR__.'/../../../autoload.php'; -$app = new Symfony\Component\Console\Application('Laravel Homestead', '6.3.0'); +$app = new Symfony\Component\Console\Application('Laravel Homestead', '6.4.0'); $app->add(new Laravel\Homestead\MakeCommand); diff --git a/resources/aliases b/resources/aliases index 10f278b4b..9ee84372b 100644 --- a/resources/aliases +++ b/resources/aliases @@ -38,6 +38,10 @@ function php71() { sudo update-alternatives --set php /usr/bin/php7.1 } +function php72() { + sudo update-alternatives --set php /usr/bin/php7.2 +} + function serve-apache() { if [[ "$1" && "$2" ]] then diff --git a/resources/localized/aliases b/resources/localized/aliases index 308fb8167..d3f7e9853 100644 --- a/resources/localized/aliases +++ b/resources/localized/aliases @@ -38,6 +38,10 @@ function php71() { sudo update-alternatives --set php /usr/bin/php7.1 } +function php72() { + sudo update-alternatives --set php /usr/bin/php7.2 +} + function serve-apache() { if [[ "$1" && "$2" ]] then diff --git a/scripts/blackfire.sh b/scripts/blackfire.sh index ac4ddd5f3..8fa2a77d2 100644 --- a/scripts/blackfire.sh +++ b/scripts/blackfire.sh @@ -25,4 +25,5 @@ echo "$client" > "/home/vagrant/.blackfire.ini" service php5.6-fpm restart service php7.0-fpm restart service php7.1-fpm restart +service php7.2-fpm restart service blackfire-agent restart diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 6d8192c97..94bc11415 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -12,7 +12,7 @@ def Homestead.configure(config, settings) # Configure The Box config.vm.define settings["name"] ||= "homestead-7" config.vm.box = settings["box"] ||= "laravel/homestead" - config.vm.box_version = settings["version"] ||= ">= 3.0.0" + config.vm.box_version = settings["version"] ||= ">= 4.0.0" config.vm.hostname = settings["hostname"] ||= "homestead" # Configure A Private Network IP @@ -228,7 +228,7 @@ def Homestead.configure(config, settings) config.vm.provision "shell" do |s| s.name = "Restarting Nginx" - s.inline = "sudo service nginx restart; sudo service php5.6-fpm restart; sudo service php7.0-fpm restart; sudo service php7.1-fpm restart" + s.inline = "sudo service nginx restart; sudo service php5.6-fpm restart; sudo service php7.0-fpm restart; sudo service php7.1-fpm restart; sudo service php7.2-fpm restart" end # Install MariaDB If Necessary @@ -315,6 +315,11 @@ def Homestead.configure(config, settings) s.args = [var["key"], var["value"]] end + config.vm.provision "shell" do |s| + s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php/7.2/fpm/php-fpm.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"]] @@ -322,7 +327,7 @@ def Homestead.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;" + s.inline = "service php5.6-fpm restart; service php7.0-fpm restart; service php7.1-fpm restart; service php7.2-fpm restart;" end end diff --git a/scripts/install-couch.sh b/scripts/install-couch.sh index 89c9e21c9..bede1a46f 100644 --- a/scripts/install-couch.sh +++ b/scripts/install-couch.sh @@ -27,3 +27,4 @@ sudo service nginx restart sudo service php5.6-fpm restart sudo service php7.0-fpm restart sudo service php7.1-fpm restart +sudo service php7.2-fpm restart diff --git a/scripts/install-mongo.sh b/scripts/install-mongo.sh index 80b34b963..4d07de1ba 100644 --- a/scripts/install-mongo.sh +++ b/scripts/install-mongo.sh @@ -58,6 +58,17 @@ sudo ln -s /etc/php/7.1/mods-available/mongo.ini /etc/php/7.1/cli/conf.d/20-mong sudo ln -s /etc/php/7.1/mods-available/mongo.ini /etc/php/7.1/fpm/conf.d/20-mongo.ini sudo service php7.1-fpm restart +phpize7.2 +./configure --with-php-config=/usr/bin/php-config7.2 > /dev/null +make clean > /dev/null +make >/dev/null 2>&1 +sudo make install +sudo chmod 644 /usr/lib/php/20160303/mongodb.so +sudo bash -c "echo 'extension=mongodb.so' > /etc/php/7.2/mods-available/mongo.ini" +sudo ln -s /etc/php/7.2/mods-available/mongo.ini /etc/php/7.2/cli/conf.d/20-mongo.ini +sudo ln -s /etc/php/7.2/mods-available/mongo.ini /etc/php/7.2/fpm/conf.d/20-mongo.ini +sudo service php7.2-fpm restart + sudo ufw allow 27017 sudo sed -i "s/bindIp: .*/bindIp: 0.0.0.0/" /etc/mongod.conf diff --git a/scripts/serve-silverstripe.sh b/scripts/serve-silverstripe.sh index b1a948629..804aca0ba 100644 --- a/scripts/serve-silverstripe.sh +++ b/scripts/serve-silverstripe.sh @@ -44,7 +44,7 @@ block="server { location ~ /framework/.*(main|rpc|tiny_mce_gzip)\.php$ { fastcgi_keep_conn on; - fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; + fastcgi_pass unix:/var/run/php/php$5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; include fastcgi_params;