在wamp上安裝xdebug網上很多文章都介紹了方法,但是我這里遇到了一個很特殊的情況,在網上很少有人提及:
我機器是win7 64位的,安裝的wamp1.7.4是32位的,這是后來導致出現奇怪現象的根源。
按照網上提供的方法如下:
進入xdebug網站,選擇測試phpinfo()信息,注意這里不是采用貼源碼的方式,是采用貼顯示出的html文字的方式。
根據測試的信息,我的信息如下:
Summary
- Xdebug installed: no
- Server API: Apache 2.0 Handler
- Windows: yes - Compiler: MS VC9 - Architecture: x86
- Zend Server: no
- PHP Version: 5.2.5
- Zend API nr: 220060519
- PHP API nr: 20060613
- Debug Build: no
- Thread Safe Build: yes
- Configuration File Path: C:\Windows
- Configuration File: D:\wamp\Apache2\bin\php.ini
- Extensions directory: d:\wamp\php\ext
注意這里看到我們的編譯器為VC9,然后我的php版本是5.2.5,而且是線程安全的因此,我就很容易去找到PHP 5.2 VC9 TS (32 bit) ,結果下載下來,按如下的配置
[Xdebug]
zend_extension_ts ="d:/wamp/php/ext/php_xdebug-2.2.3-5.2-vc9.dll"
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.trace_output_dir="d:/wamp/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="d:/wamp/php/debuginfo"
結果很悲催,重啟webserver后,phpinfo一閃就關閉了,嘗試了64位,nts各種方式都不行,要么是phpinfo關閉,要么就是xdebug不出現。
后來很偶然,我嘗試了使用vc6的編譯版本,就是zend_extension_ts ="d:/wamp/php/ext/php_xdebug-2.1.2-5.2-vc6.dll",結果通過了,一下子終於明白了,
其實自己是被誤導了,雖然機器是64位的,但是調用組件還是使用的vc6的版本進行編譯的,至此,做個提醒,希望安裝32位的注意。