php開發環境及xdebug配置

xampp集成apache mysql php等

eclipse ide for php:eclipse-php-3.0.2.v20120611144-Win32.zip
指定jdk路徑:


機器上裝了好幾個版本的jdk,要用指定的jdk啓動eclipse,只需修改eclipse.ini文件即可。

參考:

-vm
C:/jdk1.6.0_18/bin/javaw.exe (//-- 注:放第一行)
--launcher.XXMaxPermSize
256m
-vmargs
-Xms128m
-Xmx512m

其中紅色的兩行爲指定的jdk啓動地址,注意:javaw.exe使用的是bin裏的。

配置xdebug:
對應下載xdebug版本:地址:http://xdebug.org/download.php
我的php是5.4-ts,64位操作系統,下載版本爲:PHP 5.4 VC9 TS (64 bit) 修改爲php_xdebug.dll放入php的ext目錄下
apache配置:
httpd.conf:
在第129行添加:
LoadModule php5_module "D:/php-5.4.15/php5apache2_2.dll"
PHPIniDir "D:/php-5.4.15"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
修改根目錄:
DocumentRoot "D:\php-project"
<Directory "D:\php-project">
php.ini配置:
末尾添加:
[Xdebug]
zend_extension="D:\php-5.4.15\ext\php_xdebug.dll"
;xdebug.profiler_output_dir="D:\php53\xdebug"
xdebug.remote_enable=On
xdebug.profiler_enable=On
xdebug.profiler_enable_trigger=1
xdebug.default_enable=On
xdebug.show_exception_trace=On
xdebug.show_local_vars=1
xdebug.max_nesting_level=50
xdebug.var_display_max_depth=6
xdebug.dump_once=On
xdebug.dump_globals=On
xdebug.dump_undefined=On
xdebug.dump.REQUEST=*
xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT
;xdebug.trace_output_dir="D:\php53\xdebug"
eclipse pdt中修改配置:
1.配置php exec




2.配置php的debug爲xdebug
3.在項目上右鍵-debug as-debug confi中配置,這裏主要配置好file:項目的入口文件,一般爲index.php
還有URL一定要配置正確,確保在頁面上能訪問。
4.指定調試用的瀏覽器,這裏配置成chrome:需要手動添加chrome.exe的路徑
經過以上配置就可以斷點調試了。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章