1. 程式人生 > >手把手教你搭建eclipse中的php環境

手把手教你搭建eclipse中的php環境

1.下載eclipse  建議下載 Eclipse Standard (標準版)

2.在eclipse中下載 PDT(php development tools)

help->Install New Software...

work with:選擇 --All Available Sites-- (網速慢的同學稍等一下,刷出列表以後,在下拉框中輸入php)

安裝完成後回自動重啟eclipse;

3.配置php執行環境及debug環境

 1) 下載並安裝wamp整合環境
 2) 配置php 本地Run及Debug環境
	1.開啟Prefences→PHP→PHP Executables→Execution Environments →Add

	2.開啟Prefences→PHP→Debug

	3.本地php Run及Debug配置已經完成

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

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

  2. [xdebug]

  3. xdebug.profiler_enable=on

  4. xdebug.trace_output_dir="d:/wamp/logs/xdebug-log" ;xdebug 的資料檔案目錄

  5. xdebug.profiler_output_dir="d:/wamp/logs/xdebug-log" ;xdebug 的資料檔案目錄

  6. xdebug.auto_trace = On ;開啟自動跟蹤

  7. xdebug.show_exception_trace = On ;開啟異常跟蹤

  8. xdebug.remote_autostart = On ;開啟遠端除錯自動啟動 Off 關閉遠端debug可以將此項設定為Off

  9. xdebug.remote_enable = On ;開啟遠端除錯

  10. xdebug.remote_handler=dbgp ;用於zend studio遠端除錯的應用層通訊協議

  11. xdebug.remote_host=127.0.0.1 ;允許連線的zend studio的IP地址

  12. xdebug.remote_port=9000 ;反向連線zend studio使用的埠

  13. xdebug.collect_vars = On ;收集變數

  14. xdebug.collect_return = On ;收集返回值

  15. xdebug.collect_params = On ;收集引數

  16. xdebugbug.max_nesting_level = 10000

2.開啟Prefences→PHP→Debug→Installed Debuggers 選擇 XDebug
3.將測試test.php放在D:\wamp\www目錄下