无法通过流浪者

时间:2015-12-14 11:34:09

标签: php laravel-5 vagrant homestead

我正在跟随拉姆维尔的拉斯维加斯教程我已经设置了laravel工作正常现在我希望它通过我的窗户上的流浪汉。 但是,当我浏览" todo.app:8000 "时,我无法运行我的应用程序。页面没有响应并显示消息" 网页不可用"。
然而,当我第一次设置时,我可以通过" localhost:8000 "我没有" php artisan serve "命令,但不能用" todo.app:8000 "之后我更新了作曲家并重新启动了机器,事情变得更糟,现在我甚至无法使用" localhost:8000 "如果我跑" php artisan serve "它运作正常。 运行宅基地,流浪者或laravel命令也没有错误,他们工作正常。
任何人都可以告诉我我做错了什么? 这是我的homestead.yml文件

---

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

authorize: ~/.ssh/id_rsa.pub

keys:
- ~/.ssh/id_rsa

folders:
- map: ~/code
  to: /home/vagrant/code

sites:
- map: todo.app
  to: /home/vagrant/code/learning-laravel-5/public

databases:
- homestead
variables:
- key: AAP_ENV
value: local
# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

这些是我在Windows主机文件中完成的配置

    # 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 todo.app
127.0.0.1 mynew.app

如果还有其他需要,请告诉我。我已经花了一整天时间计算出来,但我已经被困在这里了。提前致谢

1 个答案:

答案 0 :(得分:1)

有几点需要解决(1和2应该解决您的问题):

  1. 您不能将todo.app指向您的127.0.0.1,您需要将127.0.0.1更改为您的VM的IP(192.168.10.10

  2. http://todo.app而不是http://todo

  3. 您有端口转发吗?从您的摘录中评论,您是否转发80到8000,或者您在VM的8000端口上运行了什么?

  4. 如果您执行localhost:8000,它会假定您已将端口80从VM转发到主机上的8000,而todo.app:8000将直接指向VM并从8000端口获取正在运行的端口。 VM。

    1. 您拥有固定的IP地址,因此您可以使用http://192.168.10.10访问您的laravel