Skip to content

环境

提示

php 7.4

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