每当我尝试登录时都会遇到问题,但是此问题仅发生在上传站点的 Ubuntu 服务器上,并且在 Windows 上使用 wamp 工作正常。
我不知道它有什么问题。我在日志文件中看不到任何内容。
这是 security.yml 文件:
security:
encoders:
Op\AppSecurityBundle\Entity\User: sha512
Symfony\Component\Security\Core\User\User: plaintext
providers:
default:
entity: { class: AppSecurityBundle:User, property: email }
role_hierarchy:
ROLE_OPTIME_ADMIN: ROLE_OPT_USER
ROLE_SUPER_ADMIN: [ROLE_OPT_USER, ROLE_OPT_ADMIN, ROLE_ALLOWED_TO_SWITCH]
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
prizes:
pattern: ^/admin|^/security|^/landing|^/reports|^/catalog
form_login:
check_path: /security/login_check
login_path: /
provider: default
success_handler: whos_online
failure_handler: whos_online
logout:
path: /security/logout
target: /
success_handler: whos_online
access_control:
- { path: ^/admin, roles: [ROLE_OPT_ADMIN] }
- { path: ^/security, roles: [ROLE_OPT_ADMIN, ROLE_OPT_USER] }
- { path: ^/landing, roles: [ROLE_OPT_ADMIN, ROLE_OPT_USER] }
- { path: ^/reports, roles: [ROLE_OPT_ADMIN, ROLE_OPT_USER] }
- { path: ^/catalog, roles: [ROLE_OPT_ADMIN] }
routing_dev.yml
_assetic:
resource: .
type: assetic
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_main:
resource: routing.yml
路由.yml
ws:
resource: "@BeSimpleSoapBundle/Resources/config/routing/webservicecontroller.xml"
prefix: /ws
security:
resource: @AppSecurityBundle/Resources/config/routing.yml
parameter:
resource: @ParameterBundle/Resources/config/routing.yml
status:
resource: @AppStatusBundle/Resources/config/routing.yml
csc:
resource: @CSCBundle/Resources/config/routing.yml
catalog:
resource: @CatalogBundle/Resources/config/routing.yml
prizes:
resource: @PrizesBundle/Resources/config/routing.yml
reports:
resource: @ReportsBundle/Resources/config/routing.yml
AppSecurityBundle/Resources/config/routing.yml
_security:
resource: "@AppSecurityBundle/Controller/AppSecurityController.php"
type: annotation
AppSecurityController.php 中的注解
/**
* @Route("/", name="_login")
* @Template()
*/
public function loginAction( )
{
//hidden
}
/**
* @Route("/security/login_check", name="_security_check")
*/
public function securityCheckAction( )
{
// The security layer will intercept this request
}
/**
* @Route("/security/logout", name="_logout")
*/
public function logoutAction( )
{
// The security layer will intercept this request
}
/**
* @Route("/landing", name="_landing")
* @Template()
*/
public function landingAction( )
{
return array ( );
}
如果这是一个愚蠢的问题,我深表歉意。我不知道为什么它可以在本地工作,但不能在服务器上工作。
我正在使用 Symfony 2.0.12 和 Ubuntu Server 11.10
补充:当我运行 php app/console router:debug 我得到
[router] Current routes
Name Method Pattern
_wdt ANY /_wdt/{token}
_profiler_search ANY /_profiler/search
_profiler_purge ANY /_profiler/purge
_profiler_import ANY /_profiler/import
_profiler_export ANY /_profiler/export/{token}.txt
_profiler_search_results ANY /_profiler/{token}/search/results
_profiler ANY /_profiler/{token}
_webservice_call POST /ws/{webservice}
_webservice_definition GET /ws/{webservice}
_login ANY /
_security_check ANY /security/login_check
_logout ANY /security/logout
_landing ANY /landing
_concurrency ANY /security/concurrency
_overwriteConcurrency ANY /security/overwriteConcurrency
_loading ANY /security/loading
_changeLanguage ANY /changeLanguage
_security ANY /security/{strategy}/{globalStrategy}
_parameter ANY /admin/{strategy}/{globalStrategy}
_status ANY /admin/{strategy}/{globalStrategy}
_csc ANY /admin/{strategy}/{globalStrategy}
_catalogs ANY /catalog/{strategy}/{globalStrategy}
_prizes ANY /admin/{strategy}/{globalStrategy}
_reports ANY /{globalStrategy}/{strategy}