eclipse 安装php插件 并配置环境
php安装
1. help->Install New Software->Add 录入下载地址:http://download.eclipse.org/tools/pdt/updates/5.3,后面一直点击next下载插件,如下图流程:
2.下载安装完需重启
3.安装wampServer或者phpstudy,这个是运行php的集成环境,你也可以选择其他环境,这里网上下载,直接安装即可
4、配置php运行环境
(1)配置php本地run
1.打开Prefences→PHP→PHP Executables→Execution Environments →Add
2.打开Prefences→PHP→Debug
3)配置php远程Debug环境
1.启动phpstudy,打开 PHP→php.ini 在结尾处加入 以下代码
zend_extension = "D:/phpStudy/php/php-5.5.38/ext/php_xdebug.dll"
[xdebug]
xdebug.profiler_enable=on
xdebug.trace_output_dir="d:/phpStudy/logs/xdebug-log" ;xdebug 的数据文件目录
xdebug.profiler_output_dir="d:/phpStudy/logs/xdebug-log" ;xdebug 的数据文件目录
xdebug.auto_trace = On ;开启自动跟踪
xdebug.show_exception_trace = On ;开启异常跟踪
xdebug.remote_autostart = On ;开启远程调试自动启动 Off 关闭远程debug可以将此项设置为Off
xdebug.remote_enable = On ;开启远程调试
xdebug.remote_handler=dbgp ;用于zend studio远程调试的应用层通信协议
xdebug.remote_host=127.0.0.1 ;允许连接的zend studio的IP地址
xdebug.remote_port=9000 ;反向连接zend studio使用的端口
xdebug.collect_vars = On ;收集变量
xdebug.collect_return = On ;收集返回值
xdebug.collect_params = On ;收集参数
xdebugbug.max_nesting_level = 10000
2.重启phpstudy
2.打开Prefences→PHP→Debug→Installed Debuggers 选择 XDebug
下图为php debug截图: