2015-05-04 42 views
1

我一直试图让laravel工作一个多星期,现在已经接近,但我无法在我的Web浏览器中进行项目。当我直接到127.0.0.1:8000时,我收到了'没有指定输入文件'。我尝试了我在网络上找到的每个解决方案,但都找不到解决方案。我正在使用最新版本的vagrant,virtualbox,composer以及宅基地我是新来的这一切,请与我裸露,如果我犯了一个愚蠢的错误任何帮助将是巨大的赞赏,重温大为头痛我YAML是:。Laravel windows 8.1浏览器没有输入文件指定


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 

流浪文件:

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文件

# 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   

回答

0

我不确定你从哪里得到了端口8000

这条线:

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

说的是,你的主计算机(您正在阅读这篇文章从什么),端口4567将被转发到您的客户机(虚拟机,你旋转起来)端口80

但是,这不是必须知道的。 Apache和Nginx默认侦听端口80,当您访问URL时,所有浏览器都会使用它。

这意味着,这条线在/etc/hosts文件,

127.0.0.1 laravel.dev 

让你去走http://laravel.dev没有任何进一步。

如果这仍然没有工作,你有几种选择:

  • 使用$ vagrant ssh进入虚拟机并读取Nginx的日志。我相信他们应该在/var/logs/nginx/{vhost_name}
  • 我有一个更老,更成熟,更强大的替代宅基地:https://puphpet.com。我已经成功地推出了Laravel,SF2,ZF2和其他无数的框架。
相关问题