溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

基于 Laravel5 開發(fā)個人博客 - laravel開發(fā)系列教程(一)

發(fā)布時間:2020-07-16 11:19:27 來源:網(wǎng)絡 閱讀:1908 作者:指尖芳華 欄目:web開發(fā)

準備工作

composer 更換國內(nèi)源
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問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI