第一步:配置php xdebug擴充
[xdebug]
zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey="sublime.xdebug"
xdebug.remote_log="/var/log/xdebug/xdebug.log"
第二步:安裝sublime xdebugclient(不是xdebug)
第三步:安裝php xdebug擴充
sublime中安裝sublime xdebug client,此處一定要安裝帶client的,而不是sublime xdebug。注意安裝完成後,在sublime中ctrl+shift+p ,輸入xdebug,如果出現以下這些選項,則已經安裝成功。
第四步:配置sublime xdebug
用sublime開啟你要調試的程式,點擊sublime導航的Project->save project as。產生一個.sublime-project的檔案,修改其為:
下面是我的MAC配置
{
"folders":
[
{
"path": "/Applications/xampp/xamppfiles/htdocs"
}
],
"settings":
{
"xdebug": {
"path_mapping": {
},
"url": "http://127.0.0.1/test.php",
"super_globals": true,
"close_on_stop": true,
"port": 9000
}
}
}
第五步:下載firebox外掛程式easiest Xdebug
點擊綠色的小爬蟲,點亮代表調試狀態開啟,第一次不點擊開啟,調試無效
第六步:測試調試
在待調試的檔案中加斷點之後,在sublime中 tools --> xdebug --> 開始調試 。此時在瀏覽器中開上面配置步驟中所設定的url:http://127.0.0.1/test.php,進入斷點,完成調試。
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
以上就介紹了mac sublime3+xdebug+firefox調試環境的搭建,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。