如何在Ubuntu的本地主机上安装带有PhpStorm的Xdebug?
我使用的是PHP7.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键”是一个不是PhpStorm的数字,当我试图放置断点时,它会忽略它们。
发布于 2018-10-18 06:24:54
我也为此而战过很久。让我们看看这是否对你有帮助。我使用的是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)按"Debug“按钮,而不是"Run”
5)可以很好地处理断点:
https://stackoverflow.com/questions/52863076
复制相似问题