ubuntu下超详细laravel5.5安装教程(包含mix)

2017-10-23  本文已影响0人  北京大奇

这堂课,需要先在机安装好putty,winscp,navicat for mysql,node这四个软件

一:登录虚拟机

注意:这样登录的账号是vagrant,不是root,我们需要一个root账户,怎么做?

二:安装一个laravel项目(包括前端)

参考:https://laravel.com/docs/5.5/mix#installation

vagrant@homestead:~/Code/study$ composer config -g repo.packagist composer https://packagist.phpcomposer.com
vagrant@homestead:~/Code/study$ composer create-project --prefer-dist laravel/laravel myblog
vagrant@homestead:~/Code/study$ cd myblog
vagrant@homestead:~/code/study/myblog$ npm i --no-bin-links

实际上是安装到了D:\www2018\study\myblog中,Code对应本机的D:\www2018,这是在homestead.yaml中配置的
npm全局安装需要root身份,如果增加root身份请参考文章的最后面
如果安装慢,改为淘宝仓库 npm install -g cnpm --registry=https://registry.npm.taobao.org
在虚拟机中安装有点问题,改在本机win10下安装

D:\www2018\study\myblog>npm i

三:连接数据库

参考: https://laravel.com/docs/5.5/homestead中Connecting To Databases
我使用Navicat for Mysql来建数据库
文件/新建连接
ip是127.0.0.1,端口是 33060,用户名是 homestead,密码是 secret,连接名我取 homestead4.0.0

新建数据库超级用户
GRANT ALL PRIVILEGES ON *.* TO 'wang'@'%' IDENTIFIED BY 'fa168' WITH GRANT OPTION;

四:增加root用户

vagrant@homestead:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
vagrant@homestead:~$

vagrant@homestead:~$ su root
Password:
root@homestead:/home/vagrant/Code/study#
上一篇下一篇

猜你喜欢

热点阅读