简体   繁体   English

使用xDebug和PhpStorm调试VM

[英]Debug VM with xDebug and PhpStorm

My work setup is a Windows XP host, running an Ubuntu VM LAMP stack. 我的工作设置是Windows XP主机,运行Ubuntu VM LAMP堆栈。 I am using PhpStorm to edit my code on my host Windows machine. 我正在使用PhpStorm在我的主机Windows机器上编辑我的代码。 Upon saving files are automatically uploaded to the VM via SFTP. 保存文件后,会自动通过SFTP上传到VM。 Everything works for this process, except debugging. 除了调试之外,一切都适用于此过程。

I have setup PhpStorm to have a server named "UbuntuVM" with the following settings: 我已经将PhpStorm设置为具有名为“UbuntuVM”的服务器,其中包含以下设置:

Debugger: 调试器:
- XDebug - XDebug
Debug session settings: 调试会话设置:
- Break at the first line - 在第一行休息
- Wait for connection with ide key: XDEBUG_PHPSTORM - 等待与ide密钥连接:XDEBUG_PHPSTORM
Before launch: 发布前:
- Upload files to selected server - 将文件上载到所选服务器

I am using Chrome with Xdebug Helper, and have set the extension to use "Other" as the IDE, with "XDEBUG_PHPSTORM" as the key. 我使用Chrome和Xdebug Helper,并将扩展设置为使用“其他”作为IDE,以“XDEBUG_PHPSTORM”为关键。

The VM has the following in the php.ini: VM在php.ini中有以下内容:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=10.1.6.22
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.collect_params=On
xdebug.show_local_vars=On

When I set a break point in my IDE, enable the debugger in Chrome, and reload the page, I never hit the break point; 当我在IDE中设置断点时,在Chrome中启用调试器,然后重新加载页面,我从未达到过断点; and the IDE says "Waiting for connection on port 9000 with ide key 'XDEBUG_PHPSTORM'". 并且IDE说“等待端口9000上的连接与ide键'XDEBUG_PHPSTORM'”。

Does anyone have any idea why I'm not hitting my break points? 有谁知道为什么我没有达到我的破发点?

来发现不需要xdebug.remote_host ,而是使用xdebug.remote_connect_back=1

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

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