52 lines
989 B
Markdown
52 lines
989 B
Markdown
---
|
||
layout: wiki
|
||
wiki: laravel #项目名
|
||
date: 2023-12-15 15:58
|
||
categories: [Laravel]
|
||
title: 环境配置
|
||
description: 项目环境配置简要说明
|
||
---
|
||
|
||
## 环境
|
||
{%radio checked:true php 7.4%}
|
||
{%radio checked:true laravel 8.x%}
|
||
|
||
```php
|
||
php artisan --version
|
||
|
||
# Laravel Framework 8.83.27
|
||
php -v
|
||
|
||
# PHP 7.4.27 (cli) (built: Dec 16 2021 22:42:18) ( NTS )
|
||
```
|
||
## 创建项目
|
||
拉取项目源码
|
||
```bash
|
||
composer create-project laravel/laravel="^8" demo
|
||
```
|
||
### 配置nginx
|
||
```yml
|
||
server {
|
||
listen 80;
|
||
server_name demo.cn; # 自行更改
|
||
root /www/source_analysis/public/; # 根目录
|
||
index index.php index.html index.htm;
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.php?$query_string;
|
||
}
|
||
|
||
location ~ [^/]\.php(/|$) {
|
||
fastcgi_pass php:9000;
|
||
include fastcgi-php.conf;
|
||
include fastcgi_params;
|
||
}
|
||
}
|
||
```
|
||
### 修改host文件
|
||
修改hosts文件,将域名映射到本机ip
|
||
```bash
|
||
127.0.0.1 demo.cn
|
||
```
|
||
|