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

时间:2016-06-29 17:46:22

标签: debugging toolbar symfony apache2.4

在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>

如果我将配置文件更改为:

<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>

访问:documentation on defining your own main,一切正常。

有什么问题?

2 个答案:

答案 0 :(得分:0)

您的网络目录(在apache配置中)应为:

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

假设'gestion'是你Symfony3(它是Symfony3?)文件夹......

快速验证(现在的方式)是尝试: http://dev.enterprise.cl/web/app_dev.php

顺便问一下,你在同一台主机上使用网络浏览器吗?如果不是,您需要像这样编辑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')
) {

其中['REMOTE_ADDR']包含主机的IP;默认情况下,它只是localhost(127.0.0.1)。

答案 1 :(得分:0)

非常感谢,解决方案是取消注释目录:

   <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,是的,我已配置app_dev,访问remotaly,谢谢