关闭

laravel 5.0 安装

887人阅读 评论(0) 收藏 举报
分类:


1. 从官网下载 5.0.22 版本的laravel

http://www.golaravel.com/download/


2.然后 copy到 网站服务器目录下:

并将 storage 和vendor文件夹设置可读写权限   

chmod -R  777 XXX/


root@cy-VirtualBox:/var/www/html/laravel5.0.2# ls

app        composer.json  database      phpspec.yml  readme.md   storage

artisan    composer.lock  gulpfile.js   phpunit.xml resources  tests

bootstrap  config         package.json  public       server.php  vendor

root@cy-VirtualBox:/var/www/html/laravel5.0.2# pwd

/var/www/html/laravel5.0.2

root@cy-VirtualBox:/var/www/html/laravel5.0.2# 


3.最后在浏览器中输入:

http://192.168.30.103/laravel5.0.2/public/



得到:

Laravel 5
Smile, breathe, and go slowly. - Thich Nhat Hanh




以下是国内镜像:

"repositories": [

        {"type":"composer","url":"http://pkg.phpcomposer.com/repo/packagist/"},

        {"packagist":false}

    ]






数据库配置:

vim   .env   修改 .env 数据库配置文件

APP_ENV=local
APP_DEBUG=true
APP_KEY=Y9p58TR46g9Osaf2czX7HUyioZqGJfaJ


DB_HOST=localhost
DB_DATABASE=laravel5
DB_USERNAME=root
DB_PASSWORD=123456


CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync


MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null


然后在mysql中先创建数据库 laravel5数据库

root@cy-VirtualBox:~# mysql -h localhost -u root -p

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 43

Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)


Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> CREATE

    -> DATABASE laravel5;

Query OK, 1 row affected (0.09 sec)



接着:

root@cy-VirtualBox:/var/www/html/laravel5.0# php artisan migrate

PHP Warning:  Module 'PDO' already loaded in Unknown on line 0

PHP Warning:  Module 'json' already loaded in Unknown on line 0

PHP Warning:  Module 'phalcon' already loaded in Unknown on line 0

Migration table created successfully.

Migrated: 2014_10_12_000000_create_users_table

Migrated: 2014_10_12_100000_create_password_resets_table

root@cy-VirtualBox:/var/www/html/laravel5.0# 



至此,数据库迁移完成

然后输入:  192.168.30.103/laravel5.0/home 跳转到注册界面








完成注册












参考:http://lvwenhan.com/laravel/432.html


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:245830次
    • 积分:3563
    • 等级:
    • 排名:第9582名
    • 原创:153篇
    • 转载:66篇
    • 译文:0篇
    • 评论:16条
    最新评论