温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

基于 Laravel5 开发个人博客 - laravel开发系列教程(一)

发布时间:2020-07-16 11:19:27 来源:网络 阅读:1900 作者:指尖芳华 栏目:web开发

准备工作

composer 更换国内源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
git

安装 laravel

composer create-project --prefer-dist laravel/laravel blog "5.5.*'   //--prefer-dist 

测试

php artisan serve   // 该命令使用本地安装的PHP自带服务器 
在浏览器访问    http://127.0.0.1:8000
显示laravel 欢迎页表示安装成功

配置

1. public 目录 配置到nginx中
#### blog-lara 配置
server {
         listen       80;
         server_name   crm.blog-lara.com;
         charset utf-8;
         #access_log  logs/host.access.log  main;
         root  F:\blog\public;
         index index.php index.html;
         if (!-e $request_filename) {
           rewrite  ^(.*)$  /index.php?s=/$1  last;
           break;
        }

         #error_page  404              /404.html;

         # redirect server error pages to the static page /50x.html
         #
         error_page   500 502 503 504  /50x.html;
                 location = /50x.html {
                 root   html;
         }
         location ~ \.php$ {
             fastcgi_pass   fastcgi_backend;
             fastcgi_index  index.php;
             include        fastcgi_params;
             fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
             fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
         }
 }

2. 配置文件

文档链接

composer 中国镜像: https://www.phpcomposer.com/
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI