简体   繁体   English

在PHPStorm中调试Symfony2项目

[英]Debug Symfony2 projects in PHPStorm

I have a problem in debugging symfony2 applications in PHPStorm with xdebug because of Request::createFromGlobals() method. 由于使用Request::createFromGlobals()方法,使用xdebug在PHPStorm中调试symfony2应用程序时遇到问题。 All other project debugs well. 所有其他项目调试良好。

The problem occurs, when the execution process meets the invocation of this method, the debugger just turns off without any error and the page is rendered. 发生问题,当执行过程满足此方法的调用时,调试器将关闭,而不会出现任何错误,并且将呈现页面。

Does someone know how to fix it? 有人知道如何解决吗?

Try change app_dev.php to: 尝试将app_dev.php更改为:

...
//$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
$loader = require_once __DIR__.'/../app/autoload.php';
require_once __DIR__.'/../app/AppKernel.php';

$kernel = new AppKernel('dev', true);
//$kernel->loadClassCache();
$request = Request::createFromGlobals();
...

I had the same issue with PhpStorm 7. The solution was to go into project settings and select Servers under PHP. 我在PhpStorm 7中也遇到了同样的问题。解决方案是进入项目设置并在PHP下选择“服务器”。 Choose the server you are using (localhost in my case) and explicitly setup the directory mapping in the symfony project folder. 选择您正在使用的服务器(在本例中为localhost),并在symfony项目文件夹中显式设置目录映射。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM