6 Replies - 255 Views - Last Post: 20 February 2018 - 10:51 AM Rate Topic: -----

#1 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Vagrant attempting to load php5

Posted 19 February 2018 - 07:41 PM

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: There was a problem while downloading the metadata for your box
==> default: to check for updates. This is not an error, since it is usually due
==> default: to temporary network problems. This is just a warning. The problem
==> default: encountered was:
==> default: 
==> default: The requested URL returned error: 404 Not Found
==> default: 
==> default: If you want to check for box updates, verify your network connection
==> default: is valid and try again.


Towards the end of the script:
    default: Failed to restart php5-fpm.service: Unit php5-fpm.service not found.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

There should be no php5 though. PHP 7.1 is installed.

Is This A Good Question/Topic? 0
  • +

Replies To: Vagrant attempting to load php5

#2 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 11137
  • View blog
  • Posts: 19,088
  • Joined: 19-March 11

Re: Vagrant attempting to load php5

Posted 19 February 2018 - 09:15 PM

Please post the Vagrantfile, or preferably a redacted version demonstrating the problem.
Was This Post Helpful? 0
  • +
  • -

#3 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Re: Vagrant attempting to load php5

Posted 19 February 2018 - 09:58 PM

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"

homesteadYamlPath = File.expand_path("~/.homestead/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")

require_relative 'scripts/homestead.rb'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
	if File.exists? aliasesPath then
		config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
	end

	Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))

	if File.exists? afterScriptPath then
		config.vm.provision "shell", path: afterScriptPath
	end
end


I thought maybe the homestead.rb was the root of the problem, but changing it to point to php7 didn't make a difference:
class Homestead
  def Homestead.configure(config, settings)
    # Configure The Box
    config.vm.box = "laravel/homestead"
    config.vm.hostname = "homestead"

    # Configure A Private Network IP
    config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"

    # Configure A Few VirtualBox Settings
    config.vm.provider "virtualbox" do |vb|
      vb.name = 'homestead'
      vb.customize ["modifyvm", :id, "--memory", settings["memory"] ||= "2048"]
      vb.customize ["modifyvm", :id, "--cpus", settings["cpus"] ||= "1"]
      vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
      vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
    end

    # Configure Port Forwarding To The Box
    config.vm.network "forwarded_port", guest: 80, host: 8000
    config.vm.network "forwarded_port", guest: 443, host: 44300
    config.vm.network "forwarded_port", guest: 3306, host: 33060
    config.vm.network "forwarded_port", guest: 5432, host: 54320

    # Add Custom Ports From Configuration
    if settings.has_key?("ports")
      settings["ports"].each do |port|
        config.vm.network "forwarded_port", guest: port["guest"] || port["to"], host: port["host"] || port["send"], protocol: port["protocol"] ||= "tcp"
      end
    end

    # Configure The Public Key For SSH Access
    if settings.include? 'authorize'
      config.vm.provision "shell" do |s|
        s.inline = "echo $1 | grep -xq \"$1\" /home/vagrant/.ssh/authorized_keys || echo $1 | tee -a /home/vagrant/.ssh/authorized_keys"
        s.args = [File.read(File.expand_path(settings["authorize"]))]
      end
    end

    # Copy The SSH Private Keys To The Box
    if settings.include? 'keys'
      settings["keys"].each do |key|
        config.vm.provision "shell" do |s|
          s.privileged = false
          s.inline = "echo \"$1\" > /home/vagrant/.ssh/$2 && chmod 600 /home/vagrant/.ssh/$2"
          s.args = [File.read(File.expand_path(key)), key.split('/').last]
        end
      end
    end

    # Register All Of The Configured Shared Folders
    settings["folders"].each do |folder|
      config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil
    end

    # Install All The Configured Nginx Sites
    settings["sites"].each do |site|
      config.vm.provision "shell" do |s|
          if (site.has_key?("hhvm") && site["hhvm"])
            s.inline = "bash /vagrant/scripts/serve-hhvm.sh $1 \"$2\" $3"
            s.args = [site["map"], site["to"], site["port"] ||= "80"]
          else
            s.inline = "bash /vagrant/scripts/serve.sh $1 \"$2\" $3"
            s.args = [site["map"], site["to"], site["port"] ||= "80"]
          end
      end
    end

    # Configure All Of The Configured Databases
    settings["databases"].each do |db|
      config.vm.provision "shell" do |s|
        s.path = "./scripts/create-mysql.sh"
        s.args = [db]
      end

      config.vm.provision "shell" do |s|
        s.path = "./scripts/create-postgres.sh"
        s.args = [db]
      end
    end

    # Configure All Of The Server Environment Variables
    if settings.has_key?("variables")
      settings["variables"].each do |var|
        config.vm.provision "shell" do |s|
					s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php/7.1/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"]]
        end
      end

      config.vm.provision "shell" do |s|
        s.inline = "service php-fpm restart"
      end
    end

    # Update Composer On Every Provision
    config.vm.provision "shell" do |s|
      s.inline = "/usr/local/bin/composer self-update"
    end

    # Configure Blackfire.io
    if settings.has_key?("blackfire")
      config.vm.provision "shell" do |s|
        s.path = "./scripts/blackfire.sh"
        s.args = [settings["blackfire"][0]["id"], settings["blackfire"][0]["token"]]
      end
    end
  end
end


And there's nothing in after.sh
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Re: Vagrant attempting to load php5

Posted 20 February 2018 - 07:05 AM

So after removing and re-adding the laravel/homestead box for the 3rd or 4th time, it's no longer complaining about php5. Still not connecting to any of the sites, but baby steps...
Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Re: Vagrant attempting to load php5

Posted 20 February 2018 - 07:45 AM

Another vagrant up shows:
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 5.0.18_Ubuntu r106667
    default: VirtualBox Version: 5.2



But then:
vagrant reload --provision

Shows the same as above, but adds this later on:
    default: Failed to restart php5-fpm.service: Unit php5-fpm.service not found.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.


So I guess it there's no progress... :helpsmilie:
Was This Post Helpful? 0
  • +
  • -

#6 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Re: Vagrant attempting to load php5

Posted 20 February 2018 - 08:55 AM

So apparently there's an issue with the vagrant box laravel/homestead not having php5 but requiring it. I'm not seeing others reporting it though, so maybe something specific to my setup?
Was This Post Helpful? 0
  • +
  • -

#7 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3798
  • View blog
  • Posts: 13,755
  • Joined: 08-August 08

Re: Vagrant attempting to load php5

Posted 20 February 2018 - 10:51 AM

So it looks like something happened to my homestead install. I created a new one and that serves the test site I installed in it. Now I just need to map the old sites.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1