Heim  >  Artikel  >  Backend-Entwicklung  >  php_xdebug安装+NetBeans的配置和使用

php_xdebug安装+NetBeans的配置和使用

WBOY
WBOYOriginal
2016-08-08 09:19:06969Durchsuche



1、php_xdebug的安装及配置:

我是用wampServer2.2的环境的,环境本身自带了对应的xdebug,只需要修改php.ini的配置就可以了。但是php.ini文件要找对,我一开始就是找错了文件,所以配了好久都不生效。

wampServer使用的php配置文件一般都放在wamp安装目录的apache里面,我的是在:D:\wamp\bin\apache\Apache2.2.21\bin\php.ini 。

可以通过phpinfo()方法查看php.ini的位置,直接搜索php.ini就可以了:

php_xdebug安装+NetBeans的配置和使用

2、修改php.ini

zend_extension = "d:/wamp/bin/php/php5.3.10/zend_ext/php_xdebug-2.1.2-5.3-vc9.dll"

#其中 zend_extension=D:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll 是php5.3以及以上版面的写法,如果是php5.2以及以下版本的是zend_extensi/php/ext/php_xdebug-2.2.1-5.4-vc9.dll。

[xdebug]
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

#下面是几个不必须的参数。

xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="D:/php/debuginfo"
xdebug.profiler_enable=on
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/wamp/tmp"
xdebug.output_buffering=off

xdebug.idekey="ide.xdebug"

trace_output_dir 对于的是类似trace.4046332594.xt的文件,
profiler_output_dir对应得是类似cachegrind.out.10360 这样的文件 

然后可以用个phpinfo()函数测试是否成功了。
 php_xdebug安装+NetBeans的配置和使用 

3、配置netbean

3.2.1重新启动wamp服务

3.2.2打开netbeans,工具——选项,找到php图标,在“常规”中PHP5解释器选择wamp中的php

如:D:\wamp\bin\php\php5.4.12\php.exe

钩选:输出窗口、web浏览器

打开“调试”选项卡,配置调试端口为9000(与php.ini中配置一样)

4、配置项目的属性

3.3.1新建一个项目,右键项目,打开“项目属性”对话框,选择“源”,PHP版本选择为wamp中的php版本一致

3.3.2选择“运行配置”,运行方式选择“本地web站点”,项目URL配置为项目的访问地址,如:http://localhost:9060/项目名/

索引文件配置为index.php

5、xdebug的使用参考:https://netbeans.org/kb/docs/php/debugging_zh_CN.html#gettingReady

参考文章:http://wayne173.iteye.com/blog/1704453

http://www.2cto.com/os/201404/294008.html





以上就介绍了php_xdebug安装+NetBeans的配置和使用,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn