Building Xdebug into PHP on ARM

May 29th, 2008 | by Sean |

So a large part of my day job consists of hacking on a small PHP application intended to run on an ARM device. We chose PHP for a number of reasons, not the least of which is the “ease” of development (PHP is not one of my favorite languages) and the reasonable performance we can achieve on ARM. Unfortunately, PHP compiles without Zend extension support on ARM making it difficult to run things like Xdebug or APD.

Problem:
# php -v
Extensions are not supported on this platform.
PHP 5.2.5 (cli) (built: May 15 2008 16:54:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Solution:
build% cd php-5.2.5/ext
build% tar xfz xdebug-2.0.3.tar.gz
build% mv xdebug-2.0.3 xdebug
build% cd ..
build% ./buildconf --force
build% ./configure --enable-xdebug
build% make && make install

This builds Xdebug straight into PHP for profiling goodness. One caveat, I get this warning when I start PHP:
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0

The warning doesn’t seem to affect much; I still get (reasonable looking) profiling data out of Xdebug.

You must be logged in to post a comment.