听说NetBeans安装xdebug插件之后,可以调试php程序,怎么配置呢?再网上查找了半天,终于搞清楚了,
1、先编写个index.php页面,代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php // put your code here phpinfo(); ?> </body> </html>
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.iniand add the linezend_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"
参考:
本文详细介绍如何在NetBeans中安装并配置Xdebug插件来调试PHP程序。首先需要创建包含phpinfo()函数的测试页面,并通过Xdebug官网找到适合的DLL文件。接下来更新php.ini文件,设置Xdebug参数,并重启Web服务器。
1130

被折叠的 条评论
为什么被折叠?



