【问题标题】:Laravel windows 8.1 Browser No Input File SpecifiedLaravel windows 8.1浏览器未指定输入文件
【发布时间】:2015-05-04 04:59:08
【问题描述】:

我已经尝试让 laravel 工作了一个多星期并且已经接近了,但是我无法在我的网络浏览器中执行该项目。当我定向到 127.0.0.1:8000 时,我收到“未指定输入文件”。我尝试了在网上找到的所有解决方案,但找不到解决方案。我使用的是最新版本的 vagrant、virtualbox、composer和宅基地。

我的 Yaml 是:


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

主机文件

    # 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           

【问题讨论】:

    标签: php laravel vagrant yaml homestead


    【解决方案1】:

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

    这一行:

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

    表示,在您的主机(您正在阅读的内容)上,端口 4567 将被转发到您的来宾计算机(您启动的 VM)端口 80

    但是,这没有必要知道。 Apache 和 Nginx 默认监听 80 端口,当你访问一个 URL 时所有浏览器都会监听它。

    这意味着你的/etc/hosts文件中的这一行,

    127.0.0.1 laravel.dev  
    

    允许你去http://laravel.dev 没有任何进一步的。

    如果这仍然不起作用,您有几个选择:

    • 使用$ vagrant ssh 进入VM 并读取Nginx 日志。我相信他们应该在/var/logs/nginx/{vhost_name}
    • 我有一个更老、更成熟、更强大的 Homestead 替代方案:https://puphpet.com。通过这个,我成功地开发了 Laravel、SF2、ZF2 和无数其他框架。

    【讨论】:

      猜你喜欢
      • 2015-09-01
      • 2017-05-22
      • 1970-01-01
      • 2013-12-26
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      • 1970-01-01
      • 2018-02-17
      相关资源
      最近更新 更多