laravel - 如何销毁和重新创建 Vagrant/宅基地机器?

标签 laravel vagrant homestead

我在 Vagrant Box (homestead) 上运行 Laravel

当我在做 vagrant up ,我收到一条消息:

: A newer version of the box 'laravel/homestead' is available and already
: installed, but your Vagrant machine is running against
: version '6.3.0'. To update to version '7.1.0',
: destroy and recreate your machine.

我应该运行哪些命令以及我应该准备哪些潜在问题?

最佳答案

您可以在销毁正在运行的 Homestead 之前为 Homestead 创建第二个安装。

1) 关注 official documentation在安装安装 Homestead Vagrant Box 时,然后,当安装 Homestead 而不是这个命令时

git clone https://github.com/laravel/homestead.git ~/Homestead

运行这个
git clone https://github.com/laravel/homestead.git ~/MyHomestead

那么你需要cd ~/MyHomesteadgit checkout v8.4.0
现在你需要去~\MyHomestead\scripts\homestead.rb文件并替换 homestead-7homestead-7-my它将为您的 virtualbox 中的虚拟机提供不同的名称。

现在你可以按照官方文档

1.1) 并且你总是可以从你的 Vagrant 文件夹中销毁你的旧 Vagrant 盒子~/homestead通过运行
vagrant destroy 

2)通过运行创建一个新的 Vagrant 盒
vagrant up --provision

3)进入 Vagrant
vagrant ssh

4)转到您的项目(我假设您有一组数据库迁移和播种机)
cd ~/code/myproject

4.1) 你会发现 redismysql已经在那里工作了。

5)创建数据库
php artisan migrate

6)如果需要,让SUPERVISOR工作

7) 如果需要,让 cron 工作

完成

关于laravel - 如何销毁和重新创建 Vagrant/宅基地机器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54848397/

相关文章:

windows - 为什么在删除 WinRM 日志时 Windows guest 配置失败?

grails - 用于 Groovy 和 Grails 开发的 Vagrant box

ruby - Laravel Homestead 的 Vagrantfile : where is $confDir supposed to be set?

homestead - 未找到 Homestead rev-manifest.json 上的 Laravel 5.2 全新安装错误

jquery - 更改页面而不刷新 - Laravel/Ajax

php - 使用 Laravel AWS SDK 在 Route53 中创建记录集时出错

php - 在 Ubuntu 中使用 nginx 和 php7.0-fpm 的 Laravel 5.4 的 502 Bad Gateway

laravel - 如何在 Laravel 中缓存模型属性

ruby-on-rails - 守卫 --listen-on with vagrant

php - 如何在 Ubuntu 18.10 上使用 Laravel Homestead 设置 HTTPS