同样的项目,用phpstudy就可以运行,但是用Laragon就报错!

用使用Laragon集成环境的吗?

Laragon的nginx配置

server {
    listen 80;
    listen 443 ssl;
    server_name niuqichongtian.test *.niuqichongtian.test;
    root "D:/laragon/www/niuqichongtian/public/";

    index index.html index.htm index.php;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
        autoindex on;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass php_upstream;        
        #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    # Enable SSL
    ssl_certificate "D:/laragon/etc/ssl/laragon.crt";
    ssl_certificate_key "D:/laragon/etc/ssl/laragon.key";
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    ssl_prefer_server_ciphers on;


    charset utf-8;

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    location ~ /\.ht {
        deny all;
    }
}

# This file is auto-generated.
# If you want Laragon to respect your changes, just remove the [auto.] prefix
让PHP再次伟大
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
最佳答案

已解决,原来是没有隐藏index.php

3年前 评论
讨论数量: 6

看看你的Nginx配置

3年前 评论
勇敢的心 (楼主) 3年前

file

太多重定向

一般都是 死循环重定向 才会被谷歌报错。
(如: /get_user 重定向到 /get_user)

3年前 评论
勇敢的心 (楼主) 3年前
勇敢的心 (楼主) 3年前

:wink: 试试 phpEnv 我以前用的 Laragon 感觉不太好用就换了

3年前 评论
勇敢的心 (楼主) 3年前

检查一下 public 目录里面的 .htaccess 或者 nginx.htaccess
php环境如果是使用控制面板做的伪静态会生成 nginx.htaccess 可能会影响到伪静态

3年前 评论
勇敢的心 (楼主) 3年前

已解决,原来是没有隐藏index.php

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!