2015-05-04 69 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和其他無數的框架。
相關問題