问题
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