章节目录
【第一篇Laravel10装置】Laravel10 + Vue3.0前后端拆散框架通用后盾源码
①
vscode 关上 laravel10-vue3-admin
②
routes/web.php
③
新增如下代码
Route::get('/hello', function () { echo "hello";});
④
运行成果,36s
⑤
剖析性能,简略hello
都要36s。连贯数据库,加上代码逻辑。预计要100s+呢。因为之前采纳的是,php artisan serve,这边换ngnix环境尝试一下,看一下访问速度是否有变动
⑥
配置ngnix
关上file:///usr/local/etc/nginx/servers/laravel10-vue3.notestore.cn
文件没有则新建哦
内容如下:
server { listen 80; server_name laravel10-vue3.notestore.cn; index index.html index.php; root /Users/beichen/Documents/laravel10-vue3-admin/backend/public; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location / { try_files $uri $uri/ /index.php$is_args$query_string; }}
⑦
重启ngnix服务brew services restart nginx
⑧
进入/etc
⑨
hosts文件,新增如下
127.0.0.1 laravel10-vue3.notestore.cn
⑩
成果如下,38s。如同变动不大,拜访仍旧很慢,晚点连贯数据库,测试一下性能