首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用设置Xdebug和PHPStorm进行调试

使用设置Xdebug和PHPStorm进行调试
EN

Stack Overflow用户
提问于 2015-09-13 19:36:38
回答 1查看 1.6K关注 0票数 0

我正在使用PHPStorm,并尝试根据这个视频https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20?autoplay=true运行Xdebug。

第一部分工作得很好(https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/19?autoplay=true),但我被第二部分卡住了。

端口9000不工作,所以我将其更改为10000。

我配置了PHP Web应用程序配置

当我按下debug按钮后,web是空白的

仍在加载,PHPStorm正在等待传入的连接。

我在php.ini的PHP - Debug - Xdebug和xdebug中选中了"can accept external connection“,配置如下:

代码语言:javascript
复制
[XDebug]

zend_extension="/usr/local/Cellar/php56-xdebug/2.3.3/xdebug.so"

xdebug.remote_enable = 1
xdebug.cli_color = 1
xdebug.show_local_vars = 1

xdebug.remote_port = 10000
xdebug.remote_host= localhost
xdebug.remote_autostart = 1

xdebug.remote_log="/usr/local/tmp/xdebug.log"
xdebug.idekey = "PHPSTORM"
xdebug.ide_key = "PHPSTORM"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir="/usr/local/tmp/xdebug-profiler"
xdebug.profiler_enable_trigger = 1

我尝试使用以下结果验证web服务器:

我在谷歌上搜索了6个小时,试图解决这个问题,请帮帮我,我在这件事上是个哑巴。

使用OS X El Capitan。

我可以调试单个脚本,但不能调试整个网站。

当我直接在网上运行-chef.dev:10000时,它显示为ERR_CONNECTION_REFUSED。

"online-chef.dev“位于本地虚拟主机。

我做错了什么?

非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2015-09-13 19:50:21

您正在尝试通过xdebug调试网页。对于debug javascript,你需要安装browser extentionThis is manual for javascript debugging

对于javascript debug,获取当前扩展端口并在以下位置输入:

对于XDebug,我不想总是单击调试按钮,所以我简单地启用了侦听连接。来自JetBrains的This is manual for XDebug

下面是我使用侦听连接xdebug配置。

代码语言:javascript
复制
xdebug.idekey = "PHPSTORM"
xdebug.remote_port = 9001
xdebug.remote_mode = "req"
xdebug.remote_host = 10.0.2.2
xdebug.remote_handler = "dbgp"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.extended_info = 1

因此,当我需要debug javascript时,我点击debug按钮。当我需要debug php的时候,我只需要放入断点。

第一次设置调试工具通常很难,但它是值得的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32549237

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档