Mus*_*abe 3 php vagrant laravel laravel-5 homestead
更新开始
而不是使用return view('welcome');我现在使用return 'woo. It works.'它使其工作.所以看起来视图的方式很糟糕.有人知道我的假设是否正确吗?因为错误的堆栈跟踪说明了一些事情
在FileViewFinder-> findInPaths('welcome',array('/ Users/mknb/work/API/testproject/resources/views'))
但不应该说/home/vagrant/testproject/resources/views吗?
更新结束
我现在几周或几个月都在使用Laravel,现在也希望将Laravel与Homestead一起使用.我现在遇到的问题是,在编辑了我之后Homestead.yaml,/etc/hosts开始流浪汉vagrant up我得到了错误
FileViewFinder.php第137行中的InvalidArgumentException:未找到视图[welcome].
当使用没有Homestead/Vagrant但使用虚拟主机的完全相同的项目时,我没有任何问题.那会是什么导致这个?
这是我的 Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: testproject
name: testproject
provider: virtualbox
authorize: /Users/mknb/.ssh/id_homestead.pub
keys:
- /Users/mknb/.ssh/id_homestead
folders:
- map: "/Users/mknb/work/API/testproject"
to: "/home/vagrant/testproject"
sites:
- map: testproject.app
to: "/home/vagrant/testproject/public"
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
Run Code Online (Sandbox Code Playgroud)
这就是 /etc/hosts
192.168.10.10 testproject.app
好吧,至少它似乎工作,服务器已启动等,但为什么我收到此错误?我还尝试使用以下两个命令清除配置缓存和路由缓存
php artisan config:cache 和 php artisan:route:cache
stacktrace的第2行看起来像这样
at FileViewFinder->findInPaths('welcome', array('/Users/mknb/work/API/testproject/resources/views')) in FileViewFinder.php line 79
Run Code Online (Sandbox Code Playgroud)
但不应该把我的流浪路径设置在这里吗?这可能是问题吗?
Mus*_*abe 11
我终于解决了这个问题.
我连接到我的流浪盒,vagrant ssh然后导航到我的testproject cd testproject并运行命令以重新生成配置php artisan config:cache