本文介绍了如何在homestead-laravel中正确设置目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PHP和laravel的新手.我已经整夜尝试了,但是问题一直在发生.设置homestead.yaml后,在命令行上运行了vagrant up.文件的完整内容如下(顺便说一句,我的操作系统是os x 10.10):

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

除数据库问题:==> default: createdb: database creation failed: ERROR: database "homestead" already exists之外,其他一切似乎都进行得很好.但是,当我在浏览器中输入站点地址:int2016.app时,会出现错误403 forbidden.我试图输入"/home/vagrant/yobichi"的目录,它是空的.我想知道如何正确设置folderssites的目录以便解决该问题?预先谢谢你!

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!

推荐答案

请尝试在Homestead.yaml中进行以下设置.还请确保您有适当的意向.

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

要创建一个全新的盒子,您可以运行vagrant destroy,然后再运行vagrant up.

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

这篇关于如何在homestead-laravel中正确设置目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 07:24