vitepress-blog/src/laravel/laravel配置.md
2024-07-08 18:15:43 +09:00

52 lines
989 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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
```