drudfe0446838 2015-05-04 04:59 采纳率: 0%
浏览 81

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           
  • 写回答

1条回答 默认 最新

  • duanouyong4228 2015-05-05 04:55
    关注

    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.
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题