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: http://yips.idevcloud.com/wiki/index.php/PASE/GCC .  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: http://xdebug.org/files/xdebug-2.3.3.tgz . Or find other versions here: http://xdebug.org/download.php .

Compile Script

#1 Get source
git clone git://github.com/xdebug/xdebug.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 PATH=$PATH:$PHP_HOME/bin:$PASE_TOOLS_HOME/bin:$AIX_TOOLS_HOME/bin
export LIBPATH=$PHP_HOME/lib:$PASE_TOOLS_HOME/lib:$AIX_TOOLS_HOME/lib
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

https://github.com/phpdave/DataDump/raw/master/xdebug.so

 Further reading if you need more information to get strarted:

http://files.zend.com/help/Zend-Server-5.6-Cluster-Manager/content/compiling_php_extensions.htm