Symfony 2 - 找不到路由错误

时间:2014-10-01 14:42:28

标签: php apache symfony debian

我的Symfony与新服务器有问题 - 如果我想运行Demo应用程序,请在日志中显示错误消息:

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"" at /var/www/test/app/cache/prod/classes.php line 1881 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /\" at /var/www/test/app/cache/prod/classes.php:1881, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException:  at /var/www/test/app/cache/prod/appProdUrlMatcher.php:30)"} []

但是当我尝试运行本地服务器时,127.0.0.1:8000上的应用程序正常运行。

我的Apache VirtualHost配置文件是:

<VirtualHost *:80>
    ServerName www.domain.cz
    ServerAlias domain.cz

    DocumentRoot /var/www/test/web

    <Directory /var/www/test/web>
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

你能帮我解决这个问题吗?

2 个答案:

答案 0 :(得分:1)

我认为它来自路由。您是否在捆绑资源路由中声明了具有模式/类似的路径

bundle_homepage:
    pattern: /
    defaults: {_controller:Bundlename:Entityname:controllername}

答案 1 :(得分:0)

问题在于演示 - 无法部署到生产环境。