先下載PHP擴展Xdebug https://xdebug.org, 能夠複製本身的phpinfo粘貼到https://xdebug.org/wizard.php中, 會生成須要下載的版本, php.ini的設置語句.php
下載好以後放入php目錄的ext文件夾中, 而後設置php.ini, 在最後加上laravel
zend_extension=php_xdebug.dll
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORMapache
而後重啓apache, 去設置phpstorm瀏覽器
1. 進入File>Settings>PHP>Servers,這裏要填寫服務器端的相關信息:
name: localhost,
host: localhost,
port: 80,
debugger: XDebug服務器
若是是自定域名則host設置自定域名, 如laravel5.iodom
2. 進入File>Settings>PHP>Debug,找到XDebug選項卡,port填9000
進入File>Settings>PHP>Debug>DBGp Proxy 填寫:
IDE key: phpStorm
host: localhost
port: 80phpstorm
設置完畢,點OK退出。ide
點菜單欄的Run>Edit Configurations… 在彈出的窗口中添加一個調試配置:插件
點擊左上角加號,選擇PHP Web Applicationdebug
填寫完畢後,在代碼裏設置斷點, 再開啓電話icno監聽, 點小甲殼蟲啓動調試
再下個瀏覽器插件, xdebug helper, 下載好以後點選項, IDE選PHPSTORM, 不想讓因此網頁顯示小甲蟲, 能夠設置domain filter
基本完事了, 調試就點開電話圖標監聽, 設置好斷點, 點小甲蟲開啓調試了, 刷新頁面可見結果