phpstorm+Xdebug配置和斷點(diǎn)調(diào)試

  1. 在本地新建一個(gè)phpinfo.php,并在瀏覽器執(zhí)行此文件。
<?php
     phpinfo();
  1. 去到!Xdebug下載頁(yè)面,選擇合適的Xdebug版本,很多配置不成功,都是因?yàn)檫@里選錯(cuò)版本,可以讓官網(wǎng)幫你選擇一個(gè)正確的版本,找到如下
image.png

點(diǎn)擊綠色超鏈接,在新頁(yè)面中的框框,把phpinfo.php的全部html網(wǎng)頁(yè)代碼(右擊查看網(wǎng)頁(yè)源代碼,Ctrl+a)復(fù)制進(jìn)去,即可得出正確的版本。

image.png
  1. 找到php.ini,在底部加入以下代碼
[Xdebug]
zend_extension = D:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.idekey= "PHPSTORM"
  1. 重啟apache/nginx服務(wù)器即可
  2. 打開phpstorm,找到
QQ圖片20170703182046.jpg
  1. 然后
QQ圖片20170703182329.png

1.點(diǎn)擊

![ ![QQ圖片20170703182817.png](http://upload-images.jianshu.io/upload_images/1493727-4f4a968f4e110596.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ](http://upload-images.jianshu.io/upload_images/1493727-7ba85a4f772f2909.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
  1. 最后去到index.php頁(yè)面,點(diǎn)擊phpstorm右上角的瓢蟲即可開始斷點(diǎn)調(diào)試。時(shí)間倉(cāng)促,未加整理請(qǐng)見諒。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容