2011-05-23 29 views
0

我的symfony项目部署在共享主机上的子域Symfony:路由不适用于安全模块

所有未固定模块的正常工作,但没有安全模块的负载,以及路由失败扔空模块和/或动作...错误。对于未认证的模块,路由工作正常。 我在日志中找不到太多,只是sfBasicSecurityFilter没有被调用。

为了解决它,

  1. 我跟着溶液在此ticket,并加入“POST”到sfRequestRoute类
  2. 我还试图 添加sf_method要求的路由
  3. 的验证模块之前被称为默认,所以为了避免名称冲突我甚至改变了模块名称
  4. 我已经多次重置缓存
  5. 它适用于所有本地环境。

任何解决方案?

[编辑]另一个实验 我用的设置的frontend_dev.php控制器,以及与所述日志从index.php的

的index.php请求路由/定价即来自比较时不安全的模块

May 23 12:37:38 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login) 
May 23 12:37:38 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout) 
May 23 12:37:38 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password) 
May 23 12:37:38 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key) 
May 23 12:37:38 symfony [info] {sfPatternRouting} Match route "home_pricing" (/pricing) for /pricing with parameters array ( 'module' => 'home', 'action' => 'pricing',) 
May 23 12:37:38 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter" 
May 23 12:37:38 symfony [info] {sfFilterChain} Executing filter "sfCacheFilter" 
May 23 12:37:38 symfony [info] {sfFilterChain} Executing filter "sfCommonFilter" 
May 23 12:37:38 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter" 
May 23 12:37:38 symfony [info] {homeActions} Call "homeActions->executePricing()" 
.... 
May 23 12:37:38 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK" 
May 23 12:37:38 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8" 
May 23 12:37:38 symfony [info] {sfWebResponse} Send content (6444 o) 

frontend_dev.php请求路由/定价是来自不安全的模块时

May 24 08:14:28 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/guard/login) 
May 24 08:14:28 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/guard/logout) 
May 24 08:14:28 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_forgot_password" (/guard/forgot_password) 
May 24 08:14:28 symfony [info] {sfPatternRouting} Connect sfDoctrineRoute "sf_guard_forgot_password_change" (/guard/forgot_password/:unique_key) 
May 24 08:14:28 symfony [err] {sfError404Exception} Empty module and/or action after parsing the URL "/frontend_dev.php/pricing" (/). 
May 24 08:14:28 symfony [info] {sfWebResponse} Send status "HTTP/1.0 404 Not Found" 

我使用.htaccess的启用路由 /public_html/.htaccess(空)

/public_html/demo/.htaccess

#RewriteEngine on 
#RewriteBase/

#RewriteCond %{REQUEST_URI} !^/web/ 
#RewriteRule .* /web/%1 [QSA] 

Options +FollowSymLinks +ExecCGI 

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    # we skip all files in /web 
    RewriteCond %{REQUEST_URI} ^/web/ 
    RewriteRule .* - [L] 

    # we rewrite all other files with .something to /web 
    RewriteCond %{REQUEST_URI} \..+$ 
    RewriteCond %{REQUEST_URI} !\.html$ 
    RewriteRule ^(.*)$ /web/$1 [L] 

    # !!! UNTESTED !!! ################################## 
    # we check if the .html version is in /web (caching) 
    #RewriteRule ^$ /web/index.html [QSA] 
    #RewriteRule ^([^.]+)$ /web/$1.html [QSA] 
    ##################################################### 

    # no, so we redirect to our front web controller 
    RewriteRule ^(.*)$ /web/index.php [QSA,L] 

</IfModule> 

# big crash from our front web controller 
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly" 

/的public_html /演示/web/.htaccess(空)

回答

0

这完全是我的错。在Windows上开发它之后,我使用/包含在sfGuard模块中的一个路径中。这造成了一个致命的错误。

在index.php或模子中做某种回声来突出显示这样的错误。

0

你是usi ng sfGuardAuht?你在部署中执行了“php symfony plugin:publish-assets”吗?

+0

谢谢。错过了,但它不能解决问题:(任何其他线索?我已经添加日志中的行 – Prasad 2011-05-24 03:11:55