|
1.安裝 xdebug 略了。網(wǎng)上有很多資料。
重點(diǎn)寫php.ini的配置
[XDebug]
復(fù)制代碼 代碼如下:
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.default_enable = On
xdebug.collect_params = On
xdebug.remote_connect_back = On //如果開啟此,將忽略下面的 xdebug.remote_host 的參數(shù)。 <一臺(tái)webserver有多個(gè)開發(fā)者的工作目錄的時(shí)候使用,如:p1.xx.com,p2.xx.com,p3.xx.com 。。。等。 >
xdebug.remote_host = 192.168.59.104 //注意這里是,客戶端的ip<即IDE的機(jī)器的ip,不是你的web server>
xdebug.remote_port = 9900 // 注意這里是,客戶端的端口<即IDE的機(jī)器的ip,不是你的web server>
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_log = "/var/www/xdebug/xdebug.log"
xdebug.remote_req = req
xdebug.auto_trace = Off
xdebug.remote_autostart = On
xdebug.show_exception_trace = 0
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
xdebug.var_display_max_depth = 15
xdebug.show_local_vars = 1
xdebug.dump_undefined = 1
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = /var/www/xdebug
phpSTORM 配置:
1.file->setings->php|Debug右側(cè)。xdebug的那一塊。 設(shè)置Debug port:9900(這里設(shè)置 的是,xdebug 吐出的debug信息,通過本機(jī)的什么端口傳輸。)
2.file->setings->php|Servers 右側(cè)。 host: 你的web服務(wù)器的域名或ip ,端口, 下面的 use path mapping 意的是,你的項(xiàng)目的目錄,對應(yīng)服務(wù)器上的,什么目錄? 這里一定要設(shè)置哦! 不然,會(huì)發(fā)生找不到文件而出錯(cuò),導(dǎo)至調(diào)試終止。
3.Run->Edit Configurations-> 增加一個(gè) php WEB APPlication 的調(diào)試點(diǎn)。 右側(cè): server 選擇你上面建立的server. starturl 設(shè)置你的入口文件。
至此,配置完畢!
這樣的請求,可以注冊一個(gè)調(diào)試客戶端哦!
http://www.aihuxi.com/****.php?XDEBUG_SESSION_START=19192
點(diǎn)擊,小蟲子圖標(biāo),即可,開始調(diào)試!
php技術(shù):解析phpstorm + xdebug 遠(yuǎn)程斷點(diǎn)調(diào)試,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。