2011-05-23 51 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