PHP XDebug Sublime Text 單步調試

來源:互聯網
上載者:User
前置環境:已經安裝好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

for ($i=0; $i < 10; $i++) {

echo $i;

}

?>

在瀏覽器裡訪問 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教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.