phpstrom使用xdebug配置方法_php技巧

來源:互聯網
上載者:User

1 到 http://xdebug.org/download.php下載xdebug。注意找到自己對應的php版本。或者可以通過 http://xdebug.org/wizard.php頁面,將phpinfo的資訊複製進去,點最下面的分析。它會告訴你要下載哪個版本,然後如何配置。

 2.開啟php.ini添加以下語句

 

複製代碼 代碼如下:

[XDEBUG]
zend_extension = "D:\Program Files (x86)\php5\ext\php_xdebug.dll"
xdebug.remote_enable=on
; 此地址為IDE所在IP
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
; 可以是任意Key,這裡設定為PHPSTORM
xdebug.idekey="PhpStorm"


3.配置IDE

在Settings裡面,選擇PHP -> Debug,在xdebug裡填入剛才設定的連接埠,確定即可。

4.配置瀏覽器

Chrome上安裝 Xdebug helper 。設定Key等於php.ini所設定的key

5.調試過程:在PhpStorm的run菜單最下面,選擇 Start Listen PHP Debug Connections 開啟監聽。當瀏覽器訪問到斷點的地方,就會PhpStorm就會自動響應。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.