Windows上具有多个站点的Laravel Homestead-“未指定输入文件”。

时间:2019-06-22 18:52:55

标签: laravel windows-8.1 homestead

问题

我做错了什么,导致Laravel Homestead无法显示多个站点?

上下文

我对Laravel和Homestead比较陌生。我以前是Mac&Linux用户,但目前在Windows 8.1上。我有Homestead和我的第一个项目正常工作。

问题

我的网站#1运行正常,可以从https://website1.test访问。但是网站2显示“未指定输入文件”。访问https://website2.test时。

事实

Homestead.yaml:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
mariadb: true
authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: C:\Users\{myUsername}\Projects
      to: /home/vagrant/code

sites:
    - map: website1.test
      to: /home/vagrant/code/website1.test/public
    - map: website2.test
      to: /home/vagrant/code/website2.test/public

databases:
    - homestead

variables:
      - key: APP_ENV
        value: local

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

C:\ Windows \ System32 \ drivers \ etc \ hosts:

# 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

192.168.10.10   website1.test
192.168.10.10   website2.test

.env:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:gTjyUOqBKhYr75h4rU4TpsGaj/iejzieonLxvCpFwrY=
APP_DEBUG=true
APP_URL=https://website2.test

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

我尝试过的

1 个答案:

答案 0 :(得分:1)

解决方案正在纠正我犯的一个错误。当我从“宅基地”框中运行laravel new(然后vagrant ssh)时,我放了“ .com”而不是“ .test”。

删除项目文件夹并重新运行cd /home/code解决了该问题。