準(zhǔn)備工作
目前創(chuàng)新互聯(lián)已為上1000家的企業(yè)提供了網(wǎng)站建設(shè)、域名、雅安服務(wù)器托管、網(wǎng)站托管、服務(wù)器租用、企業(yè)網(wǎng)站設(shè)計(jì)、清苑網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(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
測(cè)試
php artisan serve // 該命令使用本地安裝的PHP自帶服務(wù)器
在瀏覽器訪問 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/