一、下載安裝XAMPP
下載地址:https://www.apachefriends.org/download.html,
一路“Next”,安裝完畢。



二、下載Eclipse for PHP
下載地址:https://sourceforge.net/projects/phpeclipse/
直接解壓。
三、配置Eclipse for PHP




四、創建PHP工程
1.在PHP Explorer空白處右鍵->New->Other...


2.在工程上右鍵->New->Other...


編寫如下代碼:
<?php phpinfo(); ?>
五、配置XAMPP
1.配置虛擬目錄:

在配置文件添加:
Alias /test "D:/PHP/test"
<Directory "D:/PHP/test">
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
2.配置XDebug

在配置文件添加:
zend_extension="E:/xampp/php/ext/php_xdebug.dll" [Xdebug] xdebug.auto_trace = On xdebug.show_exception_trace = On xdebug.remote_autostart = On xdebug.remote_enable = On xdebug.collect_vars = On xdebug.collect_return = On xdebug.collect_params = On xdebug.trace_output_dir="D:/xDebugLog" xdebug.profiler_output_dir="D:/xDebugLog" xdebug.profiler_enable=On xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp
3.啟動Apache

六、訪問頁面就可以調試了。

