duanjiong1952 2014-12-18 14:59
浏览 474
已采纳

如何使用PHPStorm调试WordPress主题

I've installed PHPStorm (8) and trying to debug WordPress theme using xDebug. I tried chrome browser extension and some other settings in the PHP Storm settings.

I've searched a lot but still unable to attach the page to the debugger. What I want is to run the code line by line and check variables etc.

Can someone tell me what exactly is required so the debugging works?

I've following structure:

WAMP is at:  c:\wamp

Project is:  d:\projects\test

alias is: http://localhost/test/

When I opened the project in PHP Storm. It identified it as WordPress project. But it never attaches the browser to debugger.

Edit Here is the related xDebug code in php.ini

zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"

[xdebug]
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_port = 9000

I also tried true instead of 1. Also tried without providing any port.

  • 写回答

2条回答 默认 最新

  • doutongwei4380 2015-03-12 22:05
    关注

    There seem to be a lot of ways to set up debugging. There are browser plugins, and bookmark commands, and all sorts of elaborate setups.

    For the most part, I always want debugging enabled while I'm developing. If that's true for you, you might consider adding this to your php.ini file:

    xdebug.remote_autostart = 1
    

    In addition, a key part to my setup is that I have to click the button in the toolbar for "Start Listening for PHP Debug Connections", and keep this enabled while I work. This is also in the menus under "Run".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决