Laravel windows 8.1浏览器未指定输入文件

I have been trying to get laravel working for over a week now and have come close, but I am unable the project in my web browser. I receive the 'No input file specified" when I direct to 127.0.0.1:8000. I have tried every solution I have found on the web, but can not find a solution. I am using the latest version of vagrant, virtualbox, composer and homestead.

My Yaml is:


ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Projects
      to: /home/vagrant/Code

sites:
    - map: laravel.dev
      to: /home/vagrant/Code/laravel-basics/public
      hhvm: true

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local 

Vagrant file is:

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/.homestead")

homesteadYamlPath = confDir + "/Homestead.yaml"
afterScriptPath = confDir + "/after.sh"
aliasesPath = confDir + "/aliases"

require File.expand_path(File.dirname(__FILE__) + '/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
Vagrant.configure("2") do |config|
  config.vm.box = "laravel/homestead"
  config.vm.network :forwarded_port, host: 4567, guest: 80
end

Hosts File

    # Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

127.0.0.1 laravel.dev           

I'm not sure where you got port 8000 from.

This line:

config.vm.network :forwarded_port, host: 4567, guest: 80

Says that, on your master machine (what you're reading this from), port 4567 will be forwarded to your guest machine's (the VM you spin up) port 80.

However, this is not necessary to know. Apache and Nginx listen to port 80 by default, and all browsers us it when you visit a URL.

This means that this line in your /etc/hosts file,

127.0.0.1 laravel.dev  

allows you go to go http://laravel.dev without anything further.

If this is still not working, you have a few options:

  • Use $ vagrant ssh to go into the VM and read the Nginx logs. I believe they should be at /var/logs/nginx/{vhost_name}.
  • I have an older, more mature, more powerful alternative to Homestead: https://puphpet.com. I've successfully spun up Laravel, SF2, ZF2 and countless other frameworks through this.