这篇文章转载自GitHub
项目地址:https://github.com/yilanwuyu/zhai-music
技术栈
后端:thinkphp 5.1
前端:layui
数据库:mysql
安装
视频安装教程
https://www.bilibili.com/video/av46476706
依赖
composer
php 5.6+
mysql 5.5+
步骤
安装php依赖包
composer install
配置数据库,配置链接数据库名以及用户名密码
/config/database.php
创建数据库
字符编码:utf8 -- UTF-8 Unicode
导入数据库脚本,脚本位置extend/database
伪静态配置
nginx
location / {
index index.htm index.html index.php;
#访问路径的文件不存在则重写URL转交给ThinkPHP处理
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?s=$1 last;
break;
}
}
apache
项目自带apache静态化无需配置
启动项目
添加public为web根目录
若为apache服务器则默认伪静态,nginx可自行配置伪静态