如何在Laravel Homestead中修复“未指定输入文件”

时间:2019-10-06 04:55:43

标签: vagrant homestead

我在ubuntu 19.04上安装了laravel homestead,编辑了homestead.yaml,并得到“未指定输入文件”。错误。我在代码文件夹中有一个index.php。我尝试了vagrant reoload --provision,删除和重新创建vm,vagrant reload --provision,vagrant up --provision并重新启动主机。

here是宅基地虚拟机中代码目录的屏幕截图

这是我的homestead.yaml

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

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

sites:
    - map: homestead.test
      to: /home/vargrant/code

databases:
    - homestead

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

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

这是无业游民重载--provision的终端输出

==> homestead: Attempting graceful shutdown of VM...
==> homestead: Checking if box 'laravel/homestead' version '8.2.1' is up to date...
==> homestead: Clearing any previously set forwarded ports...
==> homestead: Clearing any previously set network interfaces...
==> homestead: Preparing network interfaces based on configuration...
    homestead: Adapter 1: nat
    homestead: Adapter 2: hostonly
==> homestead: Forwarding ports...
    homestead: 80 (guest) => 8000 (host) (adapter 1)
    homestead: 443 (guest) => 44300 (host) (adapter 1)
    homestead: 3306 (guest) => 33060 (host) (adapter 1)
    homestead: 4040 (guest) => 4040 (host) (adapter 1)
    homestead: 5432 (guest) => 54320 (host) (adapter 1)
    homestead: 8025 (guest) => 8025 (host) (adapter 1)
    homestead: 9600 (guest) => 9600 (host) (adapter 1)
    homestead: 27017 (guest) => 27017 (host) (adapter 1)
    homestead: 22 (guest) => 2222 (host) (adapter 1)
==> homestead: Running 'pre-boot' VM customizations...
==> homestead: Booting VM...
==> homestead: Waiting for machine to boot. This may take a few minutes...
    homestead: SSH address: 127.0.0.1:2222
    homestead: SSH username: vagrant
    homestead: SSH auth method: private key
==> homestead: Machine booted and ready!
==> homestead: Checking for guest additions in VM...
==> homestead: Setting hostname...
==> homestead: Configuring and enabling network interfaces...
==> homestead: Mounting shared folders...
    homestead: /vagrant => /home/username/Homestead
    homestead: /home/vagrant/code => /home/username/code
==> homestead: Running provisioner: file...
    homestead: /home/username/Homestead/aliases => /tmp/bash_aliases
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: mariadb because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: ohmyzsh because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: webdriver because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20191005-11177-c1v2wf.sh
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20191005-11177-16wnll5.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Certificate: homestead.test
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Site: homestead.test
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20191005-11177-1nabc4j.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Checking for old Schedule
==> homestead: Running provisioner: shell...
    homestead: Running: script: Clear Variables
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restarting Cron
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restarting Nginx
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating MySQL Database: homestead
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Postgres Database: homestead
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update Composer
    homestead: You are already using composer version 1.9.0 (stable channel).
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20191005-11177-12xf7dx.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update motd
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20191005-11177-l17uwr.sh

1 个答案:

答案 0 :(得分:0)

从Laravel文档中可以找到:https://laravel.com/docs/6.x/homestead#adding-additional-sites您的路径需要包含 public 目录,如下所示:

sites:
- map: homestead.test
  to: /home/vagrant/project1/public
- map: another.test
  to: /home/vagrant/project2/public

此外,我想指出您当前配置中的一个较小的拼写错误:

/ home / 无味 /代码

最诚挚的问候