"No input file specified" Laravel Homestead

"No input file specified" Laravel Homestead

我查看了类似问题的现有答案,但 none 的解决方案似乎对我有用。

导航至 http://fresh.app:8000/ returns no input file specified。我的本地和虚拟环境确实同步了(例如,在我的虚拟机上创建一个文件会在我的本地机器上创建相应的文件)。

vagrant upvagrant ssh 工作并且不会产生任何错误。

我的 .env 文件有 APP_URL=fresh.app

我的 .homestead/Homestead.yaml 文件:

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Code
      to: /home/vagrant/Code

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

databases:
    - homestead
    - fresh

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

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

/etc/hosts 中,在我的本地机器上我有:

127.0.0.1 fresh.app

在我的虚拟机上,在 /etc/nginx/sites-available/fresh.app:

server {
    listen 80;
    listen 443 ssl http2;
    server_name fresh.app;
    root "/home/vagrant/Code/fresh/public";

    index index.html index.htm index.php;
    ...

有什么想法吗?

folders:
    - map: /Code
      to: /home/vagrant/Code

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

我怀疑您的核心 laravel 安装在 /Code 中,因此以上内容应该可以解决您的问题。除非,你的核心安装在 /Code/fresh.

另一个可能的原因可能是/Code路径不正确。您可以通过进入项目目录并获取完整路径来进行验证。如果你在 linux,你可以这样做:

pwd

这将指定它的完整路径,然后您可以更新

folders:
   - map: /the/full/path/to/the/core

在此之后,你 运行 vagrant reload --provision

如果仍然无法正常工作,请告诉我!