我怎样才能在 laravel homestead 中修复 "No input file specified"

How can I fix "No input file specified" in laravel homestead

我在 ubuntu 19.04 上安装了 laravel homestead,编辑 homestead.yaml 并出现 "No input file specified." 错误。我在代码文件夹中有一个 index.php。我试过 vagrant reoload --provision,删除并重新创建虚拟机,vagrant reload --provision,vagrant up --provision 并重新启动主机。

here是homesteadvm

中代码目录的截图

这是我的 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

这是 vagrant reload --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

来自 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/vargrant/code

此致