您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
三六零分类信息网 > 衡水分类信息网,免费分类信息发布

PHP XDebug Sublime Text 单步调试

2026/5/16 5:06:14发布11次查看
前置环境:已经安装好lnmp
1. 安装xdebug
可以通过pear包管理来安装
sudo apt-get install php-pear
sudo pecl install xdebug
这里我们直接通过apt安装
apt-get install php5-xdebug
程序已经自动创建了默认的配置文件
配置:
xdebug.ini位置:/etc/php5/mods-available/xdebug.ini
新增如下
zend_extension=/usr/lib/php5/20131226/xdebug.so
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=cachegrind.out.%p
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=true
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.remote_autostart=0
xdebug.collect_vars = on
xdebug.collect_params = on
xdebug.auto_trace = on
xdebug.show_exception_trace = on
xdebug.trace_output_dir=/tmp
重启php5-fpm
/etc/init.d/php5-fpm restart
2. 开启调试
sublime 中 crl+alt+f9 打开调试界面
查看端口 9000
3.测试
创建文件test.php
在浏览器里访问 http://127.0.0.1/test.php
可以看到我们断点的地方 $i = 0
shift+f8: 打开调试面板
f8:打开调试面板快速连接
ctrl+f8: 切换断点
ctrl+shift+f5: 运行到下一个断点
ctrl+shift+f6: 单步
ctrl+shift+f7: 步入
ctrl+shift+f8: 步出
ctrl+shift+f7
本文地址:http://www.cnblogs.com/martin-tan/p/4921200.html
php x-debug的文件 
ubuntu下面有kcachegrind直接打开,方便trace文件加载顺序
以上就介绍了php xdebug sublime text 单步调试,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
衡水分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product