Eclipse for php+Xdebug,搭建php單步調試環境

來源:互聯網
上載者:User
環境

我的環境是Eclipse for php+nginx+xdebug。

工具

  • Eclipse for php
  • Xdebug

具體步驟

1. 安裝Xdebug

  • 把下載好的xdebug檔案放在php的ext目錄下。

  • 修改php.ini

在PHP檔案夾裡面找到php.ini,在這個檔案的最後面加入如下配置資訊:
【PS:“;”開頭的語句為備註陳述式。我的xdebug版本為php_xdebug-2.4.0rc3-5.6-vc11.dll】

zend_extension = F:\DevEnv\PHP\ext\php_xdebug-2.4.0rc3-5.6-vc11.dll;zend_extension_ts = F:\DevEnv\PHP\ext\php_xdebug-2.4.0rc3-5.6-vc11.dll;extension = php_xdebug-2.4.0rc3-5.6-vc11.dll[Xdebug]xdebug.auto_trace = Onxdebug.show_exception_trace = Onxdebug.remote_autostart = Onxdebug.remote_enable = Onxdebug.collect_vars = Onxdebug.collect_return = Onxdebug.collect_params = Onxdebug.trace_output_dir=”D:/xDebugLog”xdebug.profiler_output_dir=”D:/xDebugLog”xdebug.profiler_enable=Onxdebug.remote_host=localhostxdebug.remote_port=9000xdebug.remote_handler=dbgp
  • 修改好後啟動nginx與php。【PS:php本來已經啟動的話要重新啟動,因為修改了配置。】

2. 配置Eclipse

  • 在Eclipse裡開啟項目,在項目的Properties裡面找到”PHP Debug”進行配置。


- PHP Server我們選擇建立一個。

最後剩下的Path Mapping可以不改。

選Finish,可以看到修改好的php server了。

OK,回到Properties介面,選擇剛剛建立的php-test。

OK,php debug修改完。

最後還要配置一下Run->Debug Configurations。

所有配置完畢!

最後在Eclipse裡測試一下:

如果沒問題Eclipse會自動進入debug模式。

PS:也可以在瀏覽器輸入網址訪問,這時如果你的eclipse是開啟的,而且php.ini的xdebug開啟了,配置也沒問題的話也是會進入eclipse的debug狀態的。

好了,大家慢慢享受單步調試的樂趣吧哈哈哈~~~

參考文章:
Eclipse for php + Xdebug搭建PHP的調試環境

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介紹了Eclipse for php+Xdebug,搭建php單步調試環境,包括了方面的內容,希望對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.