After you compiled and installed php, you can find phpize in /usr/local/php/bin/ directory or in whatsoever you supplied as --prefix when ran configure. This file "knows" how your php was compiled and where API headers are. So, dbg building script deferphpize simply calls phpize and expects it to create configure script. Then everything go by regular scenario. You run configure with appropriate arguments, then make and make install. Then you copy dbg.so to directory for php extensions and include it in php.ini as described in
http://www.php-debugger.com/ site