This is post for Andy Youens and anyone looking to compile PHP Extensions on IBM i.  The first thing i would do is get GCC on the IBM i by following Tony’s guide here: .  GCC is the compiler system that can take a PHP extension  source code, which are written in C, and compile it into an .SO file that can be added via PHP.ini.  In Andy’s case he want’s xdebug and you can get the latest source code here: . Or find other versions here: .

Compile Script

#1 Get source
git clone git://
#change to xdebug directory
cd xdebug
#2 setup environment variables for configure and make
export IBM_DB_HOME=/usr
export PHP_HOME=/usr/local/phpdave7
export PASE_TOOLS_HOME=/QOpenSys/usr
export AIX_TOOLS_HOME=/usr/local
export CC=gcc
export CFLAGS="-DPASE -I=.:$PHP_HOME/php/include"
export CCHOST=powerpc-ibm-aix6.1.0.0
#3 Compile
phpize && ./configure –build=$CCHOST –host=$CCHOST –target=$CCHOST –cache-file=../config.cache && gmake && gmake test && gmake install

Why can’t we just use any old binary? 

The source code has to be compiled to the processor and the operating system you’re running it on.  In the case of IBM i , the PASE environment is basically AIX (IBM’s flavor of UNIX) and it runs on IBM’s Power processor.

Binary compiled for PHP 7.1

 Further reading if you need more information to get strarted: