1.獲取到phpinfo信息
Ctrl+A選擇所有文本,Ctrl+C複製
2. Xdebug 官網下載合適的 dll 文件
打開窗口:http://xdebug.org/wizard.php ,把步驟一複製的文本添加到輸入框,如圖:
之後如圖:按照 Instructions 一步一步操作。
3. 設置 php.ini
官網文檔:https://www.jetbrains.com/phpstorm/help/configuring-xdebug.html
4. 下載 Xdebug helper(谷歌瀏覽器擴展插件,可能需翻牆)
chrome 網上應用商店https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=zh-CN
鏈接:http://pan.baidu.com/s/1bMQeNc 密碼:uczf
谷歌瀏覽器擴展程序配置,選擇 phpStorm,把網址的域名加入白名單。
之後訪問白名單裏的站點,就可以看到如下:
4. 下載 phpStorm
官網下載:https://www.jetbrains.com/phpstorm/download/#section=windows-version
註冊時選擇 License server,填寫 http://idea.lanyus.com/
hosts文件添加一行:0.0.0.0 account.jetbrains.com
5. 配置php環境
6. 配置 debug
保證端口號和php.in中的一致,如果沒有設置端口,默認就是9000。
設置 DBGp Proxy
7. 設置 PHP Web Application
設置 server
添加配置,在 phpStorm 右上角,選擇Edit Configurations...,然後配置站點
斷點調試
Start Listening for PHP Debug Connections
設置斷點
訪問該Action
phpStorm 會自動彈出,我們這樣查看變量: