网站首页> 博客> 安装phphub5-laravel社区之旅

安装phphub5-laravel社区之旅

好文 5126
格式化记忆
收藏

1. 首先安装(以下下载存放的路径根据个人情况)

vagrant_1.9.0.msihttps://releases.hashicorp.com/vagrant/1.9.0/vagrant_1.9.0.msi),

vituralBox 5.1.14 http://download.virtualbox.org/virtualbox/5.1.14/VirtualBox-5.1.14-112924-Win.exe,

git

 

2. 使用 Git 命令下载定制版的 Homestead:git clone https://git.coding.net/summerblue/homestead.git Homestead

下载项目源代码:git clone https://github.com/summerblue/phphub5.git

3. 用迅雷下载virtualbox: https://vagrantcloud.com/laravel/boxes/homestead/versions/5.2.0/providers/virtualbox.box。下载后并取名为virtualbox.box

 

图片1.png

这是本人存放的路径。VirtualBox VMs默认会在C盘,我把它也弄到这里,否则会占用C盘很大的容量。

4. 打开Homestead文件夹,执行git命令:bash init.sh(初始化Homestead

运行以上命令后,会在 ~/Homestead 目录下生成以下三个文件:

· Homestead.yaml - 主要配置信息文件,我们可以在此文件中配置 Homestead 的站点和数据库等信息;

· after.sh - 每一次 Homestead 盒子重置后(provision)会调用的 shell 脚本文件;

· aliases - 每一次 Homestead 盒子重置后(provision),会被替换至虚拟机的 ~/.bash_aliases 文件中,aliases 里可以放一些快捷命令的定义。

5.修改Homestead.yaml配置

图片2.png

Folders里的map根据个人的phphub5存放路径来配,其余一样。

6执行 vagrant box add laravel/homestead D:\vagrant\virtualbox.box(后面的路径根据个人情况)

7.修改Homestead文件夹下script下的homestead.rb文件

config.vm.box_version = settings["version"] ||= "0"

8. 修改C:\Windows\System32\drivers\etc下的hosts文件配置

192.168.10.10   phphub5.app

图片3.png

9.phphub5目录下cmd或者git执行cp .env.example .env 生成配置文件,打开.env文件修改配置

图片4.png

10. git命令执行 ssh-keygen -t rsa -C your_email@example.com(请将 your_email@example.com 替换为你的邮箱

11.打开Homestead目录用cmd或者git执行 vagrant up(打开虚拟机vagrant halt关闭虚拟机)。执行成功后继续执行vagrant ssh 连接虚拟盒子,有时候不成功,你可以直接打开virtualBox。登录账号和密码都是vagrant

12.执行composer install(等待下载完毕)

13.在虚拟机盒子执行 cd phphub5 接着继续执行php artisan est:install

 

14.接着登录mysql导入数据用户名和密码按照刚刚配的,端口号是33060

 

导入sql语句

 

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('1', '0', '0', '100', '招聘', 'zhao-pin', '发布招聘贴前请必须仔细阅读 社区招聘发帖规范,你也可以直接使用 招聘帖子模板,不按规范发帖会被管理员 永久下沉。', '2018-04-03 10:20:35', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('3', '0', '0', '97', '公告', 'gong-gao', '社区公告,小朋友不要做坏事哦。', '2018-04-03 16:33:13', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('4', '0', '0', '99', '问答', 'wen-da', '新手问答,请仔细阅读 关于《提问的智慧》,低质量问题,不遵循规范,管理员会 永久下沉。\r\n请保持排版清晰,信息完整', '2018-04-03 10:24:55', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('5', '0', '0', '98', '分享', 'fen-xiang', '分享创造,分享知识,分享灵感,分享创意,分享美好的东西。排版清晰,内容精良的话,我们会为话题加精,加精后的帖子将会被推荐到网站首页、手机端首页、精华帖周报邮件、微博官方账号。', '2018-04-03 10:22:20', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('6', '0', '0', '98', '教程', 'tutorial', '教程文章请存放在此分类下,转载请在文章中注明「转载于xxx」', '2018-04-03 10:21:37', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('8', '0', '0', '98', '专栏', 'blog', '用户自己创建的专栏信息。', '2018-04-03 16:33:17', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('9', '0', '0', '98', '生活', 'life', '分享生活', '2018-04-03 10:24:58', NULL, NULL);

INSERT INTO `homestead`.`categories` (`id`, `parent_id`, `post_count`, `weight`, `name`, `slug`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES ('10', '0', '0', '98', '头条', 'hunt', '分享生活', '2018-04-03 14:32:26', NULL, NULL);

 

· 导完数据后打开网址首页地址:http://phphub5.app/

 


  • 没有任何评论
个评论
格式化记忆

格式化记忆 (铂金)

95216金币 (273)粉丝 (31)源码

一切皆有可能!!!

 

加入微信群,不定期分享源码和经验
签到活跃榜 连续签到送额外金币
最新博客
校园跑腿系统外卖系统软件平台大学生创业平台搭建 455
壹脉销客智能名片CRM系统小程序可二开源码交付部署 438
为啥没搞了 646
Nginx 的 5 大应用场景,太实用了! 922
CentOS 8-stream 安装Postgresql 详细教程 1078
JAVA智慧校园管理系统小程序源码 电子班牌 Sass 模式 1046
Java智慧校园系统源码 智慧校园源码 智慧学校源码 智慧校园管理系统源码 小程序+电子班牌 790
Java智慧校园系统源码 智慧校园源码 智慧学校源码 智慧校园管理系统源码 小程序+电子班牌 774
致远OA权限 1261
发博客会有金币吗 807