Linux上給PHP安裝Xdebug調試

來源:互聯網
上載者:User

安裝Xdebug

wget http://xdebug.org/files/xdebug-2.2.7.tgz
tar zxvf xdebug-2.2.7.tgz
cd xdebug-2.2.7
phpize
./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
make
make install

編譯完成接下來修改php.ini配置, 在次之前你也可以先去 你的 php 安裝路徑下的lib 庫目錄看看是否產生了xdebug.so檔案,如果產生了就把下面這些加入 php.ini 檔案

;no-debug-non-zts-20090626 這個檔案夾名稱和php版本是一一對應的

zend_extension= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"

xdebug.default_enable = On

xdebug.show_exception_trace = On

xdebug.show_local_vars = 1

xdebug.max_nesting_level = 50

xdebug.var_display_max_depth = 6
xdebug.dump_once = On

xdebug.dump_globals = On

xdebug.dump_undefined = On

xdebug.dump.REQUEST = *

xdebug.cli_color = 2
重啟php-fpm,隨便寫段錯誤的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.