加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

Symfony 2:404未找到当tryes打开/app_dev.php时出错

发布时间:2020-12-13 13:57:23 所属栏目:PHP教程 来源:网络整理
导读:尝试打开时收到此错误消息 /app_dev.php An error occurred while loading the web debug toolbar (404: Not Found).Do you want to open the profiler? 当我点击确定,我得到的错误: app_dev.php/_profiler/5053258a822e1 和 404 Not found 我正在使用nginx
尝试打开时收到此错误消息

/app_dev.php

An error occurred while loading the web debug toolbar (404: Not Found).

Do you want to open the profiler?

当我点击确定,我得到的错误:

app_dev.php/_profiler/5053258a822e1

404 Not found

我正在使用nginx

非常感谢您的帮助.

编辑:这是错误日志:

[error] 18369#0: *9 open() "/var/www/Symfony/web/app_dev.php/_wdt/5056f875afc98" failed (20: Not a directory),client: 127.0.0.1,server: symfony,request: "GET /app_dev.php/_wdt/5056f875afc98 HTTP/1.1",host: "symfony",referrer: "http://symfony/app_dev.php"
[error] 18369#0: *9 open() "/var/www/Symfony/web/404" failed (2: No such file or directory),referrer: "http://symfony/app_dev.php"

编辑2:

当我尝试访问app_dev.php页面打开,但没有工具栏,当我尝试与app_dev.php /我得到

**Oops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. **

错误.

我知道这不完全是你所问的,但可能会帮助未来的人搜索这个问题,像@yvoyer建议的,我的问题是尾随的斜杠,我的服务器使用nginx和fpm,在nginx //不是euqal /,所以我不得不对我的虚拟主机conf做一些修复,并且在此之后工作正常.我只需要为任何需要的人粘贴conf,或者建议一个更好的.
location / {
            try_files $uri @pass_to_symfony;
    }

    location ~ /app_dev.php/ {
            try_files $uri @pass_to_symfony_dev;
    }

    location @pass_to_symfony{
            rewrite ^ /app.php?$request_uri last;
    }

    location @pass_to_symfony_dev{
            rewrite ^ /app_dev.php?$request_uri last;
    }

    location ~ ^/app(_dev)?.php($|/) {
            include fastcgi_params;
            fastcgi_pass   unix:/var/run/php5-fpm.sock; # replace with your sock path
    }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读