xampp安裝后會(huì)自動(dòng)集成xdebug,目錄一般為 /opt/lampp/lib/php/extensions/***-debug-***目錄
關(guān)于php 與php.ini路徑
php程序路徑為:/opt/lampp/bin/
php.ini配置文件路徑為:/opt/lampp/etc/
1、配置文件一般在/opt/lampp/etc/php.ini
修改php.ini在文件最底部加入下面項(xiàng)
[XDebug]
zend_extension ="/opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.profiler_enable=on
xdebug.trace_output_dir="/opt/lampp/tmp"
xdebug.profiler_output_dir="/opt/lampp/tmp"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9099
xdebug.auto_trace = On
xdebug.show_exception_trace = On
xdebug.show_local_vars = On
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
一定要注意9099這個(gè)端口,系統(tǒng)默認(rèn)是9000如果你這里設(shè)置的不是9000要注意修改eclipse debug選項(xiàng)
具體在debug configurations ->debug->configurations->debug port
二、設(shè)置eclipse 步驟
打開Eclipse,在里面設(shè)定xdebug, window->preferences->PHP->Debug, PHP Debugger 選擇 Xdebug Server 選擇 php Default Web Server, php Executalbe 點(diǎn)進(jìn)去之后按Add, 在Executable Path按Browse,選擇/opt/lampp/bin/php ,php ini文件路徑在/opt/lampp/etc/php.ini ,
名字嘛,隨便給個(gè)就好,叫php吧,php debuger選擇XDebug ,點(diǎn)ok
三、最后一定重起apache