dotibrb048760 2015-06-22 13:22
浏览 86
已采纳

正确使用Laravel Homestead

I have done few projects with laravel. I also tried to use the good practise such us using only models for all calls and use artisian commands.

In my next project i plan to use still more such as using Homestead.

I read more about Laravel Homestead which actually needs Vagrantup.

But i don't know the actual need of Homestead and how to install it.

enter image description here

Any help would be helpful for me and future readers.

  • 写回答

1条回答 默认 最新

  • duanjin9035 2015-06-22 16:04
    关注

    I assume you already install VirtualBox or VMWare. After downloading Homestead from Git, you need to amend Homestead.yaml file

    ip: "192.168.10.10"
    memory: 2048
    cpus: 1
    
    authorize: /Users/Documents/workspace/myssh.pub #pub path 
    
    keys:
        - /Users/Documents/workspace/myssh   #ssh key
    
    folders:
        - map: /Users/Documents/workspace/dev/myProject #My project directory
           to: /home/vagrant/code/myProject  #Vagrant project directory, no need to change this /home/vagrant/code/
    sites:
        - map: yourproject.app   #you can change whatever you prefer
           to: /home/vagrant/code/myProject/public #no need to change this /home/vagrant/code/
    
    variables:
        - key: APP_ENV
          value: local
    

    Then, we remain one final step to amend. Open hosts file under /etc/. I will use VI to amend this. You can use whatever you like.

    vi /etc/hosts
    

    enter image description here

    You need to add new line in this file

    192.168.10.10   yourproject.app  //same with code line 11
    

    Finally, you just only need to run vagrant up. Please don't forgot one thing. If you shutdown your PC without shutdown your vagrant, it's take too long to shutdown your PC. Even your PC is shutdown, vagrant might be crushed when you run again vagrant up. Before your shutdown your PC, you need to run vagrant halt for safe.

    Hope this help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备