踩了幾波坑壳影,按照網(wǎng)上的流程按照完后卻無(wú)法斷點(diǎn)調(diào)試宴咧,根本原因是phpstorm與web服務(wù)器的地址沒(méi)有設(shè)置正確径缅。
https://xdebug.org/wizard.php 將phpinfo的源代碼粘貼到表單內(nèi),提交后桃笙,按照返回的步驟沙绝,一步步按照即可
安裝完以后闪檬,php.ini加上如下配置,還有其他的,可以查一下文檔自行補(bǔ)充
[xdebug]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.8.255
xdebug.remote_port=9000
xdebug.remote_idekey=PHPSTORM
注意的是xdebug.remote_port要與phpstorm上配置的端口一致
其他的配置與網(wǎng)上一樣
image.png
image.png
此處很重要行您,踩了幾次坑。
image.png
由于本地有很多目錄,如果只填host的話笛质,phpstorm會(huì)找不到對(duì)應(yīng)的目錄妇押。需要一一對(duì)應(yīng)到項(xiàng)目上