Symfony 使用MAMP在PhpStorm上调试PHPUnit
我想在使用phpunit文件时使用断点。我的项目是一个Symfony项目,我使用MAMP Pro 3.2.1 这是我的配置: 当我启动调试模式(PhpStorm顶部栏中有绿色bug)时,我收到以下输出:Symfony 使用MAMP在PhpStorm上调试PHPUnit,symfony,phpunit,phpstorm,Symfony,Phpunit,Phpstorm,我想在使用phpunit文件时使用断点。我的项目是一个Symfony项目,我使用MAMP Pro 3.2.1 这是我的配置: 当我启动调试模式(PhpStorm顶部栏中有绿色bug)时,我收到以下输出: /Applications/MAMP/bin/php/php5.6.7/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.
/Applications/MAMP/bin/php/php5.6.7/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php --configuration "/Users/bob/Documents/Lavori Personali/webCamBundle/app/phpunit.xml.dist" Barno\WebcamBundle\Tests\Controller\WebcamControllerTest "/Users/bob/Documents/Lavori Personali/webCamBundle/src/Barno/WebcamBundle/Tests/Controller/WebcamControllerTest.php"
Testing started at 14:03 ...
Process finished with exit code 255
如果我在代码中使用断点
我检查了文件中的错误,发现了这个
[02-Jun-2015 14:26:57 Europe/Berlin] PHP Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php on line 49
[02-Jun-2015 14:26:57 Europe/Berlin] PHP Stack trace:
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 1. {main}() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:0
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 2. IDE_PHPUnit_Loader::init() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:209
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 3. IDE_PHPUnit_Loader::detectPHPUnitVersionId() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:196
[02-Jun-2015 14:26:57 Europe/Berlin] PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/Applications/MAMP/bin/php/php5.6.7/lib/php') in /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php on line 49
[02-Jun-2015 14:26:57 Europe/Berlin] PHP Stack trace:
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 1. {main}() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:0
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 2. IDE_PHPUnit_Loader::init() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:209
[02-Jun-2015 14:26:57 Europe/Berlin] PHP 3. IDE_PHPUnit_Loader::detectPHPUnitVersionId() /private/var/folders/0h/tzk_113d4_lcd6rf_bzwjmhr0000gn/T/ide-phpunit.php:196
- 安装xdebug模块
- 检查您使用的PHP版本
- php--ini
- 设置IDE设置
- 首选项>语言和框架>PHP>
- 将语言级别设置为此项目的正确PHP版本
- 设置解释器(设置加载PHP可执行文件bin目录的父目录)
- 单击…按钮>单击+按钮>其他本地>设置PHP可激发路径
- 首选项>语言和框架>PHP>
- 现在让我们让它工作
- 运行>编辑配置>单击左侧的绿色+按钮>选择php web应用程序
- 名称:任何示例ur{应用程序名称-调试器}
- 服务器:localhost(浏览>+>name:where |主机:localhost或127.0.0.1)
- 单击“确定”
- 启动url:ur项目主页的链接:
- 单击“确定”
- 现在设置断点并单击调试