php - Laravel nginx 路由在 localhost ubuntu 18.04 中不起作用
问题描述
我在我的本地系统 ubuntu 18.04 和 php 7.4 中安装了 nginx,当我运行其他站点时它可以正常工作但是当我尝试运行 laravel 站点时,它说找不到文件,任何人都可以帮我解决这个问题,下面是我的默认文件它存在于 /etc/ngix/sites-available
#
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php$is_args$args;
autoindex on;
#try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
请任何人帮助我,我需要一个文件,我可以在其中运行所有 laravel 项目,就像我们在 apache 中一样。谢谢
解决方案
推荐阅读
- python - pd.pivot:整齐到宽数据帧转换错误
- python - Python,Pandas Dataframe,列,其中包含前面所有内容的总和,并为 df 中的新项目重新开始
- kubernetes - 调用 webhook 失败“namespace.sidecar-injector.istio.io”
- android - 自定义布局 Android Compose 可测量宽度
- python - 为什么 sqlalchemy 声明性基础对象没有属性“查询”?
- javascript - 检查数组中的日期是否包含晚于当前日期的日期
- python - 如何将向量分离为基向量?
- flutter - 在 Flutter 中实现时 Listview.builder 不显示我的图像
- c# - 取消订阅委托与函数中的事件
- php - Twilio PHP:如何验证 Connect 应用程序?