1

I've got a problem with the symfony 2 debug toolbar.

This bar appear very well in each page I visit in GET method.

But when I want to sent a form, the form is well sent, but the debug toolbar don't appear, and this alert comes :

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

Do you want to open the profiler?

The only message in the profiler is

Token not found

Token "96eda5" was not found in the database.

When I don't want to open profiler, in order to inspect the page with the Chrome inspector, I see this errors:

Failed to load resource: the server responded with a status of 404 (Not Found)  http://mysite/_wdt/96eda5

Maybe could it be a problem with this _wdt ??

PS :

I didn't create database, I don't need [I think], it's just a visual website without datas...

Maybe this question can't be resolve with this informations so don't hesitate to ask me more infos...


Answer :

It was because my folder wasn't in good chmod... www-data couldn't access to this files.

Community
  • 1
  • 1
BENARD Patrick
  • 30,363
  • 16
  • 99
  • 105

3 Answers3

0

Are you redirecting after making a POST? If so, I would first enable redirect interception in dev environment and see if the toolbar is present during intercept.

If you are not making a redirect, don't bother with the above. Try to validate the HTML structure in your templates where you have forms. Also try to clear cache.

What web server are you using?

tomazahlin
  • 2,137
  • 1
  • 24
  • 29
  • maybe you can find an answer here? http://stackoverflow.com/questions/12424864/symfony-2-404-not-found-error-when-tryes-to-open-app-dev-php – tomazahlin May 06 '14 at 06:18
  • Yes I've seen this post before asking, but the problem is that I can access the toolbar, every time except when I post a form... – BENARD Patrick May 06 '14 at 10:57
  • Try to look at source code, whenever you dont see the toolbar loaded. Or take a look into symfony dev log or apache log. – tomazahlin May 06 '14 at 20:13
0

I just found the same error message with Symfony2 on nginx, and solved by setting passinfo for nginx. Within /etc/nginx/sites-available/mysite (vhost settings), replace:

server {
    root /path/to/project;
    index index.html index.htm;

    server_name site.local;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
    #       fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #       # With php5-cgi alone:
    #       fastcgi_pass 127.0.0.1:9000;
           # With php5-fpm:
           fastcgi_pass unix:/var/run/php5-fpm.sock;
           fastcgi_index index.php;
           include fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #       deny all;
    #}
}

to:

server {
    root /path/to/project;
    index index.html index.htm;

    server_name site.local;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #

    location ~ \.php {   **remove the `$` symbol**
           fastcgi_split_path_info ^(.+\.php)(/.+)$;    **unmark this line**
    #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #       # With php5-cgi alone:
    #       fastcgi_pass 127.0.0.1:9000;
           # With php5-fpm:
           fastcgi_pass unix:/var/run/php5-fpm.sock;
           fastcgi_index index.php;
           include fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #       deny all;
    #}
}

Hope this helps.

squarer
  • 63
  • 4
0

I am using nginx+hhvm. Same problem and same fix as squarer's:

Simplely change this line in /etc/nginx/hhvm.conf

from:

location ~ \.(hh|php)$ {

to

location ~ \.(hh|php)($|/) {

restart nginx - that's it.

drstockz
  • 66
  • 2