- 在本地新建一個(gè)phpinfo.php,并在瀏覽器執(zhí)行此文件。
<?php
phpinfo();
- 去到!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
- 找到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"
- 重啟apache/nginx服務(wù)器即可
- 打開phpstorm,找到
QQ圖片20170703182046.jpg
- 然后
QQ圖片20170703182329.png
1.點(diǎn)擊

](http://upload-images.jianshu.io/upload_images/1493727-7ba85a4f772f2909.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 最后去到index.php頁(yè)面,點(diǎn)擊phpstorm右上角的瓢蟲即可開始斷點(diǎn)調(diào)試。時(shí)間倉(cāng)促,未加整理請(qǐng)見諒。