【问题标题】:How to install Xdebug with PhpStorm on localhost on Ubuntu?如何在 Ubuntu 的 localhost 上使用 PhpStorm 安装 Xdebug?
【发布时间】:2018-10-17 20:26:39
【问题描述】:

如何在 Ubuntu 的 localhost 上使用 PhpStorm 安装 Xdebug?
我正在使用 PHP 7.2 和 PhpStorm 2018.2。

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

[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 Key”不是 PhpStorm 的数字,当我尝试放置断点时它会忽略它们。

【问题讨论】:

标签: php xampp phpstorm xdebug


【解决方案1】:

我也为此奋斗了很多。让我们看看这是否对您有帮助。我用的是windows,但原理应该是一样的。

1) 请确定,PHP Storm 使用您编辑的 php.ini。可以不一样。

我的 php.ini xdebug 设置:

[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) 按“调试”按钮,而不是“运行”

5) 适用于断点:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-06
    • 2020-08-07
    • 2021-04-12
    • 2021-12-05
    • 1970-01-01
    • 2011-01-11
    • 2014-11-14
    • 1970-01-01
    相关资源
    最近更新 更多