vijucat’s tinkering

March 11, 2006

How I got PHPEclipse + the DBG debugger working on Windows

Filed under: mumble — vijucat @ 12:47 am

Whew! I finally got PHP 5.1.1 debugging working with PHPEclipse on Windows XP.

My plan was to use XAMPP for the Apache, PHP, and MySQL part, and then set up PHPEclipse. There are many pages describing how to do this on the net, but getting it working involved some subtleties that took up 1 full day of tweaking.

My setup :

  1. OS : Windows XP
  2. XAMPP 1.5.1, i.e., 
    • MySQL 5.0.18
    • Apache 2.2.0
    • PHP 5.1.1
    • phpMyAdmin 2.7.0 pl1
  3. Then I installed PHPEclipse (for Eclipse 3.1) using the Update Manager as described on this plog4u page. This was a breeze.
  4. Then I downloaded and set up DBG and PHPEclipse as described here on plog4u. Of particular mention on this wiki page is Robert Kraske’s php_dbg.dll for PHP 5.1.1, which you will want unless you are ok with building it from scratch.

The whole plog4u wiki, and that page (”Installing the DBG Debugger”) in particular are gems. Thanks to whoever took all the screenshots, man!!

But after I got all the pieces in place as per the instructions on the above pages, I faced some issues. Here’s a list of issues and how I resolved them:

O========= Issues and resolutions ===========O

  • Issue : php_dbg.dll was not loading up (How do you know? Use Process Explorer from sysinternals.com and look at the apache process DLLs)
  • Resolution : I was working with the wrong php.ini. You have to work with the php.ini in apache/bin, not php/bin !!
  • Issue : The eclipse debugger just hangs.
  • Resolution : php_dbg.dll was being loaded with zend_extension_ts. You have to use extension=, NOT the zend_extension_ts=

Sample from my apache/bin/php.ini:

;[Zend]
; VJ : this doesn’t work, use extension= in the debugger section
;zend_extension_ts = “C:\xampp\php\ext\php_dbg.dll�
;zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll�
;zend_extension_manager.optimizer_ts = „C:\xampp\php\zendOptimizer\lib\Optimizer“
;zend_optimizer.enable_loader = 0
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path =

[debugger]
extension=php_dbg.dll
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost 127.0.0.1
;debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16
debugger.JIT_host = clienthost
debugger.JIT_port = 7869

  • Issue : Eclipse complains An internal error occurred during: “Debug Source lookupâ€?
  • Resolution : I was giving the full path to the file in Remote Sourcepath. Instead, you should just give the path up to the directory in which your php file is located.
  • Issue : Clicking on the source screws up the PHP Browser display! This is obviously bad, since I will need to see the output web page as well as look around the code!
  • Resolution : Uncheck this option in the PHP preferences : “Refresh PHP browser view when opening editorâ€?

I also tried using the debugbreak() method which some people recommended. This works, but native eclipse breakpoints are of course much more convenient.

January 31, 2006

Ode to the VC++ 6 compiler/linker

Filed under: mumble — vijucat @ 2:37 pm

I am the drained brain,
I and the ass in the pain,
I will trouble you again and again,
“Error LNK2001: unresolved external symbol _main”

(With apologies to the hard working guys that must’ve taken years to write the compiler. :) . Heck, I’d take a lifetime.)

This is in rememberance of those fond days in the last century (yep, 1998 is THAT far ago) when I started using Visual Studio 6.0. ‘Twas a good IDE.

Next Page »

Blog at WordPress.com.