在Intellij IDEA或者PhpStorm下用X-debug调试PHP
2015-05-29 00:00
821 查看
用Intellij IDEA或者PhpStorm使用X-debug来调试PHP,主要需要配置的部分有三个地方,分别为php.ini的配置,IDEA的配置和浏览器的配置,主要如下,以备忘:
php.ini的主要配置如下所示,关键参数根据实际情况可以修改:
[Xdebug]
zend_extension_ts=”X:/App/php-5.2.17-Win32-VC6-x86/ext/php_xdebug-2.1.1-5.2-vc6.dll”
xdebug.remote_host=jichengdiaoding.com
xdebug.remote_port = 9000
xdebug.remote_mode = “req”
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.idekey = “netbeans-xdebug”
xdebug.profiler_enable=on
xdebug.trace_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
xdebug.profiler_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.show_exception_trace = On
xdebug.remote_autostart = On
xdebug.collect_vars = On配置好了,在CMD里面输入X:/App/php-5.2.17-Win32-VC6-x86/php.exe -m,如果能看到XDebug模块,说明开启成功。
*: 值得注意的是,这里需要确定好XDebug和PHP的对应版本
IDEA的配置如下:
进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填要调试的主机名 (如:jichengdiaoding.com或者localhost等),host填(如:localhost或者amiku.cn等),port填 80,debugger选XDebug
进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认
进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 netbeans-xdebug,host 填jichengdiaoding.com,port 填80
在Firefox或者Chrome浏览器中,找到对应的X-Debug版本的插件,如下为Firefox下的调试插件:
工具的设置里的IDE KEY填上netbeans-xdebug,把jichengdiaoding.com加入到白名单,以后调试的时候把工具启用就好了
在IDEA中打开PHP的监听,然后就可以进入debug模式,方便的打断点和查看变量以及监测等。
配置完成。
php.ini的主要配置如下所示,关键参数根据实际情况可以修改:
[Xdebug]
zend_extension_ts=”X:/App/php-5.2.17-Win32-VC6-x86/ext/php_xdebug-2.1.1-5.2-vc6.dll”
xdebug.remote_host=jichengdiaoding.com
xdebug.remote_port = 9000
xdebug.remote_mode = “req”
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.idekey = “netbeans-xdebug”
xdebug.profiler_enable=on
xdebug.trace_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
xdebug.profiler_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.show_exception_trace = On
xdebug.remote_autostart = On
xdebug.collect_vars = On配置好了,在CMD里面输入X:/App/php-5.2.17-Win32-VC6-x86/php.exe -m,如果能看到XDebug模块,说明开启成功。
*: 值得注意的是,这里需要确定好XDebug和PHP的对应版本
IDEA的配置如下:
进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填要调试的主机名 (如:jichengdiaoding.com或者localhost等),host填(如:localhost或者amiku.cn等),port填 80,debugger选XDebug
进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认
进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 netbeans-xdebug,host 填jichengdiaoding.com,port 填80
在Firefox或者Chrome浏览器中,找到对应的X-Debug版本的插件,如下为Firefox下的调试插件:
工具的设置里的IDE KEY填上netbeans-xdebug,把jichengdiaoding.com加入到白名单,以后调试的时候把工具启用就好了
在IDEA中打开PHP的监听,然后就可以进入debug模式,方便的打断点和查看变量以及监测等。
配置完成。
相关文章推荐
- QQ聊天机器人for PHP版 (登录,收、发消息)
- setcookie,getcookie,delcookie,setpostBgPic
- PHPCMS如何实现后台访问限制?
- phpcms v9 自定义伪静态的分页函数
- Win2008 R2 IIS7.5+PHP5(FastCGI)+MySQL5环境搭建教程
- phpcms v9二级栏目生成到根目录后三级栏目无法访问的解决办法
- php 与 C# 之间的DES加解密
- 在PHP中使用Mockery进行测试驱动开发(TDD) - 上
- PHP 错误与异常 笔记与总结(9)自定义错误处理器
- PHP实现4种排序算法
- itms-services协议:跳转网页部署及PHP动态生成 iOS渠道包IPA一键安装之plist地址
- H.264 RTP payload 格式
- 走入PHP-declare、ticks、encoding、include
- 走入PHP-变量、运算符
- 新手使用thinkphp时打开debug出现的问题。
- 走入PHP-数据类型和字符串语法
- PHP读取CURL模拟登录时生成Cookie文件
- PHP Pthread多线程 操作
- PHP5.3以上版本使用pthreads PHP扩展真正支持多线程
- PHP Official Account Services Unavailable, Try Again Later