首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在Ubuntu的本地主机上安装带有PhpStorm的Xdebug?

如何在Ubuntu的本地主机上安装带有PhpStorm的Xdebug?
EN

Stack Overflow用户
提问于 2018-10-18 04:26:40
回答 1查看 2.7K关注 0票数 1

如何在Ubuntu的本地主机上安装带有PhpStorm的Xdebug?

我使用的是PHP7.2和PhpStorm 2018.2。

我试过install apt-get install xdebug,然后我编辑了php.ini

代码语言:javascript
复制
[Xdebug]  
zend_extension=/usr/lib/php/20170718/xdebug.so  
xdebug.remote_autostart = 1  
xdebug.remote_enable = 1  
xdebug.remote_enable = 1  
xdebug.remote_port = 9001  
xdebug.profiler_enable = On  
xdebug.remote_handler=dbgp  
xdebug.remote_host=localhost  
xdebug.remote_mode=req  
xdebug.idekey=PHPSTORM  

然后当我转到php.info时,我看到“IDE键”是一个不是PhpStorm的数字,当我试图放置断点时,它会忽略它们。

EN

回答 1

Stack Overflow用户

发布于 2018-10-18 06:24:54

我也为此而战过很久。让我们看看这是否对你有帮助。我使用的是windows,但原理应该是一样的。

1)请确保PHP storm使用的是您编辑的php.ini。它可以是不同的。

我的php.ini xdebug设置:

代码语言:javascript
复制
[xdebug]
zend_extension="E:\Apache24\php\7.2.9\php_xdebug-2.7.0beta1-7.2-vc15-x86_64.dll"
xdebug.remote_autostart=0
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="E:\Apache24\php\7.2.9\tmp"
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.show_local_vars=0
xdebug.profiler_append = 0
xdebug.idekey=xdebug
xdebug.remote_mode=req

2)如果您看到这个,则说明扩展没有正确安装:

3)检查xdebug扩展的版本是否与您的php版本对应。

4)按"Debug“按钮,而不是"Run”

5)可以很好地处理断点:

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

https://stackoverflow.com/questions/52863076

复制
相关文章

相似问题

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