简体   繁体   English

路由Symfony 2 404探查器调试工具栏

[英]Routing Symfony 2 404 profiler debug toolbar

In a fresh installation of Symfony 3, the debug toolbar not showing, when I have the apache 2.4.7 configuration file: 在全新安装的Symfony 3中,当我具有apache 2.4.7配置文件时,调试工具栏未显示:

<VirtualHost *:80>
    ServerAdmin info@enterprise.cl
    ServerName dev.enterprise.cl
    #ServerAlias www.domain.tld
    DocumentRoot /var/www/html/gestion/web
    DirectoryIndex app_dev.php

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeScript assets
    # <Directory /var/www/html/gestion>
    #     Options FollowSymlinks
    # </Directory>

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>

If I change the configuration file to: 如果我将配置文件更改为:

<VirtualHost *:80>
    ServerAdmin info@enterprise.cl
    ServerName dev.enterprise.cl
    # ServerAlias www.domain.tld
    DocumentRoot /var/www/html/gestion/web
    # DirectoryIndex app_dev.php

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeScript assets
    # <Directory /var/www/html/gestion>
    #     Options FollowSymlinks
    # </Directory>

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>

And access: http://dev.enterprise.cl/app_dev.php , all going ok. 并访问: http : //dev.enterprise.cl/app_dev.php ,一切正常。

What is wrong? 怎么了?

Your web directory (in apache config) should be: 您的Web目录(在apache配置中)应为:

<Directory /var/www/html/gestion/web>

Presuming that 'gestion' is you Symfony3 (is it Symfony3?) folder... 假设“妊娠”是您的Symfony3(是Symfony3吗?)文件夹...

A quick verify (the way it is now) is try: http://dev.enterprise.cl/web/app_dev.php 尝试快速验证(现在的方式): http : //dev.enterprise.cl/web/app_dev.php

By the way, are you using a web browser on the same host? 顺便说一句,您是否在同一主机上使用Web浏览器? If not you'll need to edit the app_dev.php file like so: 如果不是,则需要像下面这样编辑app_dev.php文件:

if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['192.168.40.208', '192.168.255.99',
            '127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
) {

Where that ['REMOTE_ADDR'] contains the IP of your host; 其中['REMOTE_ADDR']包含您主机的IP; by default it's just localhost (127.0.0.1). 默认情况下,它只是本地主机(127.0.0.1)。

Thank a lot, the solution is uncomment the directive Directory: 非常感谢,解决方法是取消注释指令Directory:

   <VirtualHost *:80>
        ServerAdmin info@enterprise.cl
        ServerName dev.enterprise.cl
        # ServerAlias www.domain.tld
        DocumentRoot /var/www/html/gestion/web
        # DirectoryIndex app_dev.php

        # uncomment the following lines if you install assets as symlinks
        # or run into problems when compiling LESS/Sass/CoffeScript assets
        <Directory /var/www/html/gestion>
            Options FollowSymlinks
        </Directory>

        ErrorLog /var/log/apache2/project_error.log
        CustomLog /var/log/apache2/project_access.log combined
  </VirtualHost>

Alvin, yes I have configure app_dev, to access remotaly, thanks Alvin,是的,我已经将app_dev配置为可以远程访问,谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM