一、下载安装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
六、访问页面就可以调试了。