听说NetBeans安装xdebug插件之后,可以调试php程序,怎么配置呢?再网上查找了半天,终于搞清楚了,
1、先编写个index.php页面,代码如下:
2、在http://xdebug.org/find-binary.php 中粘贴index.php中phpinfo()信息
3、点击按钮,将得到类似如下的提示信息:
Instructions
- Download php_xdebug-2.1.0-5.3-vc9.dll
- Move the downloaded file to D:/php/ext
- Edit
C:/WINDOWS/php.ini
and add the line
zend_extension = D:/php/ext/php_xdebug-2.1.0-5.3-vc9.dll
- Restart the webserver
根据提示下载你所需要的dll,放到指定目录下,然后重启web服务器,就可以调试程序了。
根据php.ini文件配置大致如下所示:
zend_extension = D:/php/ext/php_xdebug-2.1.0-5.3-vc9.dll
[Xdebug]
xdebug.default_enable=on
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.max_nesting_level=100
xdebug.profiler_enable=on
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
;设置xdebug输出文件,主要是纪录一些函数调用所花费的时间
xdebug.trace_output_dir="D:/php/xdebug"
xdebug.profiler_output_dir="D:/php/xdebug"
参考:
http://xdebug.org/find-binary.php
http://xdebug.org/download.php