Laravel 宅基地不工作

Laravel homestead not working

我正在尝试设置 Homestead,但无法正常工作。我遵循了 https://laravel.com/docs/5.2/homestead 上的文档并观看了 laracast 上的视频。但仍然无法弄清楚为什么它不起作用。当我转到 test.app:8000 时,会显示以下消息:

No input file specified.

另外,当我更改 homestead.yaml 文件中的路径时,我执行 "vagrant provision"。

这是我的 homestead.yaml 文件的样子(在 Homestead/Homestead.yaml 中):

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/documents/vagrant/sites
      to: /home/vagrant/Code

sites:
    - map: test.app
      to: /home/vagrant/Code/test

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

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

我的文件夹路径:“~/documents/vagrant/sites”确实存在,因为我可以 cd 进入它。我还将 test.app 添加到我的 etc/hosts 文件中(见屏幕截图)。

我做错了什么...现在尝试设置宅基地几个小时!

在您的 /etc/hosts 中将 127.0.0.1 test.app 替换为 192.168.10.10 test.app

替换

sites:
- map: test.app
  to: /home/vagrant/Code/test

sites:
- map: test.app
  to: /home/vagrant/Code/test/public

然后 运行 vagrant provision.

在您的测试目录中创建 index.php,或者如果您正在使用 laravel,请将您的代码更改为此

 sites:
        - map: test.app
          to: /home/vagrant/Code/test/public

也许这个主题可以帮助您理解问题http://laravel.io/forum/06-04-2014-no-input-file-specified-using-homestead