1. 程式人生 > >eclipse 安裝php外掛 並配置環境

eclipse 安裝php外掛 並配置環境

1、首先安裝eclipse,到官網自行下載即可,這裡不再詳細描述eclipse的安裝步驟

2、php外掛地址: http://www.eclipse.org/pdt/,裡面講的很詳細,可以選擇直接下載已經安裝好php外掛的eclipse,也可以在現有的eclipse中直接安裝php外掛,兩種方式隨便選擇
這裡寫圖片描述

3、安裝wampServer,這個是執行php的整合環境,你也可以選擇其他環境,這裡網上下載,直接安裝即可

4、配置php執行環境
(1)配置php本地run
1.開啟Prefences→PHP→PHP Executables→Execution Environments →Add

這裡寫圖片描述

2.開啟Prefences→PHP→Debug
這裡寫圖片描述

3)配置php遠端Debug環境
1.啟動wamp,開啟 PHP→php.ini 在結尾處加入 以下程式碼
2.重啟wamp
這裡寫圖片描述

zend_extension = "d:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"  

[xdebug]  
xdebug.profiler_enable=on  
xdebug.trace_output_dir="d:/wamp/logs/xdebug-log"        ;xdebug 的資料檔案目錄  
xdebug.profiler_output_dir="d:/wamp/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.開啟Prefences→PHP→Debug→Installed Debuggers 選擇 XDebug

這裡寫圖片描述

3.將測試test.php放在D:\wamp\www目錄下
在位址列輸入http://localhost/test.php eclipse中會產生斷點

說明:
eclipse在選擇工作空間的時候將工作空間直接選擇到wamp的www目錄下,
這樣更加方便。