我有一个应用程序,它使用SF2,FOS-RestBundle,MySQL,AngularJS。 Symfony仅用于为我在Angular中编写的前端应用程序提供REST API。当我已经启用调试模式一切都很正常,我的API网址 像:FOS其余 - 生产环境问题
“HOST /app_dev.php/api/users”
但是当我切换到生产环境,改变我的URL :
“HOST/API /用户”
我不断收到这样的错误:
{"error":{"code":500,"message":"Internal Server Error"}}
这是我FOSRest配置(和SENSIO框架):
sensio_framework_extra:
view: { annotations: false }
router: { annotations: true }
request: { converters: true }
fos_rest:
routing_loader:
default_format: json
include_format: true
param_fetcher_listener: force
body_listener: true
allowed_methods_listener: true
view:
view_response_listener: 'force'
formats:
json: true
format_listener:
rules:
- { path: '^/api', priorities: ['json', 'xml'], fallback_format: null, prefer_extension: true }
- { path: '^/', priorities: [ 'text/html', '*/*'], fallback_format: null, prefer_extension: true }
access_denied_listener:
json: true
我知道,在某处FOSRestBundle引发了错误,但我有一个ExceptionController“断点”。它甚至没有去那里。
Screenshot of error and headers
得到任何帮助。
你能得到服务器日志(可能是Apache),所以你看到的实际错误,而不仅仅是500错误? –