PhpStorm &XAMPP - 调试未启动 [英] PhpStorm & XAMPP - debugging not starting
问题描述
我在使用 PhpStorm 调试器时遇到了困难.我阅读了他们的所有文档,并正确设置了调试(根据 phpinfo()
、调试定制安装报告和 PhpStorm 分析).
I am having a hard time with PhpStorm debugger. I read all their documentation and I have setup debug properly (according to both phpinfo()
, debug tailored installation report and PhpStorm analysis).
但是,无论我尝试什么,调试器都不会触发.
However, no matter what I try, the debugger wont trigger.
我的设置如下:
我将 XAMPP 文档根目录更改为:c:\src\project\www
I changed XAMPP document root to: c:\src\project\www
我的项目具有以下结构:
My project has the following structure:
project
| www (used by XAMPP to serve the website)
| src
| --theme (symlinked to wp-content/themes)
| --plugins (symlinked to wp-content/plugins)
显然,此设置可以正常工作,因为我的所有插件和主题都可以正常工作并显示在屏幕上.
and apparently, this setup works as all my plugins and theme are correctly working and displayed on the screen.
当我开始运行调试器时,它根本不会触发.
When I then start to run the debugger, it simply won't trigger.
这是 PhpStorm 上调试器的设置:
This is the setup for the debugger on PhpStorm:
服务器:
Host: localhost
Port: 80
Debugger: xdebug
映射(我认为有问题的地方)
Mappings (where I think there's something off)
src/theme --> c:/src/project/www/wp-content/theme/
src/plugins --> c:/src/project/www/wp-content/plugins/
但没有任何反应.没有映射错误,没有调试,什么都没有.
but nothing happens. No mappings errors, no debug, nothing at all.
你能解释一下我在这里做错了什么吗?
Can you please explain to me what am I doing wrong here?
如果您需要更多信息,请告诉我.
let me know if you need more info.
php.ini 添加了用于调试的行(来自 xdebug 网站):
php.ini added line for debug (from xdebug website):
zend_extension = C:\xampp\php\ext\php_xdebug-2.5.4-7.1-vc14.dll
PhpStorm PHP 设置:
PhpStorm PHP settings:
推荐答案
这是我的设置:
php.ini
[xdebug]
;zend_extension=xdebug.so
zend_extension=/usr/local/Cellar/php55-xdebug/2.4.0/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9002
xdebug.remote_log="/mnt/log/xdebug.log"
xdebug.remote_autostart=1
xdebug.idekey=phpstorm
xdebug.remote_mode = req
phpstorm :
按照以上参数进行设置.请注意,我使用端口 9002 来避开与 php-fpm
的冲突,后者是我的堆栈的一部分.此外,我强制 xdebug 登录特定驱动器以减轻笔记本电脑 SSD 等的负担......适应您的配置.
setup in accordance with above parameters. Note that I use port 9002 to skit around a conflict with php-fpm
which is part of my stack. Also, i force xdebug logging on a specific drive to ease the burden on my laptop SSD, etc ... Adapt to your configuration.
这篇关于PhpStorm &XAMPP - 调试未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!