gpt4 book ai didi

php - 在 Laravel/Homestead 中映射文件夹和站点

转载 作者:行者123 更新时间:2023-12-03 20:30:52 25 4
gpt4 key购买 nike

我一直在努力让 Laravel/Homestead 在 ubuntu 15.1 上运行,并且正在努力将我的文件夹和站点映射到我的 Homestead.yaml 文件中。虚拟机已启动并正在运行,当我在浏览器中转到 Homestead.app 时,它告诉我没有指定输入文件。我知道我没有正确映射它。

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

authorize: ~/.ssh/id_rsa.pub

keys:
- ~/.ssh/id_rsa

folders:
- map: ~/Homestead/Projects/Laravel
to: /home/vagrant/Projects

sites:
- map: homestead.app
to: /home/goldenos/Homestead/Projects/public

databases:
- homestead

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

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

我的 index.php 文件位于 ~/Homestead/Projects 中名为 Laravel 的文件夹中,如果我需要提供任何其他信息,请告诉我,我会尽快提供。提前感谢您提供任何信息!-卢克

最佳答案

试试这个:

folders:
- map: ~/Homestead/Projects // your local whole projects folder on the host machine (so you can setup multiple websites on the same virtual box)
to: /home/vagrant/Projects // synced folder in virtual box

sites:
- map: homestead.app
to: /home/vagrant/Projects/Laravel/public // path of project in the virtual box
- map: site2.app
to: /home/vagrant/Projects/Site2/public

不要忘记在编辑 .yaml 文件后运行 vagrant up/reload flagging --provision ,例如:

vagrant up --provision

vagrant reload --provision

关于php - 在 Laravel/Homestead 中映射文件夹和站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37801631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com