How to set the directory properly in homestead-laravel?

て烟熏妆下的殇ゞ 提交于 2019-12-13 01:56:44

问题


I am a newbie in PHP and laravel. I have tried the whole night but problems keep occurring. After I set up the homestead.yaml, I ran vagrant up on the command line. The full content of file is as below(BTW, my OS is os x 10.10):

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

authorize: ~/.ssh/github_rsa.pub

keys:
- ~/.ssh/github_rsa

 folders:
- map: "/Users/yobichi"
  to: "/home/vagrant/yobichi"

sites:
- map: int2016.app
  to: "/home/vagrant/yobichi/public"

databases:
- homestead    

everything seems going well, except an issue of database: ==> default: createdb: database creation failed: ERROR: database "homestead" already exists. But when I enter the site address: int2016.app on the browser, an error of 403 forbidden occurs. And I tried to enter the dir of "/home/vagrant/yobichi", it was empty. I wonder how should I set the directory of folders and sites properly so that I can solve the problem? Thank you in advance!


回答1:


Please try the following set up in your Homestead.yaml. Please also make sure that you have got proper intendation.

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: int2016
name: int2016
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: "/Users/yobichi/laravel/int2016"
      to: "/home/vagrant/yobichi"

sites:
    - map: int2016.app
      to: "/home/vagrant/yobichi/public"

databases:
    - homestead

To create a complete new box you can run vagrant destroy and after that vagrant up again.



来源:https://stackoverflow.com/questions/37241540/how-to-set-the-directory-properly-in-homestead-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!