WampServer(php5.2.1)+Eclipse Helios+Xdebug

2011年05月15日

WampServer Version 2.1 本身自带的php版本是5.3,但是ecshop需要使用5.2的。
个别函数已经在5.3中被优化掉了。

---
WampServer --php-Version-Get more...
下载到自己需要的版本WampServer2-PHP521.exe
安装后 更改php版本--WampServer --php-Version--5.2.1
打开http://localhost/?phpinfo=1
查看源文件--复制所有,粘贴到http://xdebug.org/find-binary.php 这个页面上的表单中--'Analyse my phpinfo() output'
得到的结果是:
 

Summary

  • Xdebug installed: no
  • Server API: Apache 2.0 Handler
  • Windows: yes - Compiler: MS VC6 - Architecture: x86
  • Zend Server: no
  • PHP Version: 5.2.1
  • Zend API nr: 220060519
  • PHP API nr: 20060613
  • Debug Build: no
  • Thread Safe Build: yes
  • Configuration File Path: unknown
  • Configuration File: unknown
  • Extensions directory: d:\wamp\bin\php\php5.2.1\ext

Instructions

  1. Download php_xdebug-2.1.1-5.2-vc6.dll
  2. Move the downloaded file to d:\wamp\bin\php\php5.2.1\ext
  3. Create php.ini in the same folder as where php.exe is and add the line
    zend_extension_ts = d:\wamp\bin\php\php5.2.1\ext\php_xdebug-2.1.1-5.2-vc6.dll
  4. Restart the webserver



按照提示下载 php_xdebug-2.1.1-5.2-vc6.dll 放到 d:\wamp\bin\php\php5.2.1\ext 目录
打开D:\wamp\bin\apache\Apache2.2.17\bin\php.ini(这里不要修改php目录下的php.ini)
在最后添加一行 zend_extension_ts = d:\wamp\bin\php\php5.2.1\ext\php_xdebug-2.1.1-5.2-vc6.dll
运行Eclipse后 如果出现waiting for Xdebug session。则需要更改一下端口号!(默认的是9000)
在php.ini中再添加三行。
xdebug.remote_enable = On
xdebug.remote_host="localhost"
xdebug.remote_port=19000

记得在eclipse中也要更改端口号,window-preferences-php-debug-installed Debugger--xdebug更改为19000

重启wampserver,再Debug as 运行。

---
这时就能看到断点被断住了!

 

PHP

  1. avatar
    零九三
    November 26th, 2011 at 20:43 pm
    [回复]
    写的不错。对我帮助蛮大