$ perl -wle 'use PHP::Interpreter'
Can't load '/usr/local/lib/perl/5.8.8/auto/PHP/Interpreter/Interpreter.so' for module PHP::Interpreter: /usr/local/lib/perl/5.8.8/auto/PHP/Interpreter/Interpreter.so: undefined symbol: zend_ce_traversable at /usr/lib/perl/5.8/DynaLoader.pm line 225.
at -e line 1
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
####
$ php5 -v
PHP 5.2.4-2ubuntu5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 27 2008 20:43:54)
$ uname -a
Linux foo 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux
$ perl -v
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
####
26c26
< my @incdirs = map { s/^-I//g; chomp; $_ } split(/ /, $inc);
---
> my @incdirs = map { s/^-I//g; chomp; $_ } grep { /^-I/ } split(/ /, $inc);
####
$ perl Makefile.PL
using php version 5.2.4-2ubuntu5
using prefix /usr
using includes -I/usr/include -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
using lddlflags -shared -L/usr/local/lib -L/usr/lib -L/usr/lib
using libs -L/usr/lib -lphp5
Checking header files...
using incdir '/usr/include'
using incdir '/usr/include/php5'
using incdir '/usr/include/php5/main'
using incdir '/usr/include/php5/TSRM'
using incdir '/usr/include/php5/Zend'
using incdir '/usr/include/php5/ext'
using incdir '/usr/include/php5/ext/date/lib'
Found /usr/include/php5/Zend/zend.h
Found /usr/include/php5/Zend/zend_ini.h
Found /usr/include/php5/Zend/zend_interfaces.h
Found /usr/include/php5/Zend/zend_compile.h
Found /usr/include/php5/Zend/zend_API.h
Found /usr/include/php5/TSRM/TSRM.h
Found /usr/include/php5/main/php.h
Found /usr/include/php5/main/php_config.h
Found /usr/include/php5/main/php_ini.h
Found /usr/include/php5/main/SAPI.h
Found /usr/include/php5/main/php_main.h
Note (probably harmless): No library found for -lphp5
Writing Makefile for PHP::Interpreter
####
$ make
cp lib/PHP/Interpreter/Resource.pm blib/lib/PHP/Interpreter/Resource.pm
cp lib/PHP/Interpreter/Class.pm blib/lib/PHP/Interpreter/Class.pm
cp a.pl blib/lib/PHP/a.pl
cp b.pl blib/lib/PHP/b.pl
cp lib/PHP/Interpreter.pm blib/lib/PHP/Interpreter.pm
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap typemap PHP.xs > PHP.xsc && mv PHP.xsc PHP.c
cc -c -I/usr/include -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -DVERSION=\"1.0.1\" -DXS_VERSION=\"1.0.1\" -fPIC "-I/usr/lib/perl/5.8/CORE" PHP.c
In file included from /usr/include/php5/main/php.h:34,
from phpinterp.h:11,
from PHP.xs:13:
/usr/include/php5/Zend/zend.h:34:1: warning: "END_EXTERN_C" redefined
In file included from PHP.xs:3:
/usr/lib/perl/5.8/CORE/perl.h:242:1: warning: this is the location of the previous definition
PHP.c: In function ‘XS_PHP__Interpreter__Resource_FETCH’:
PHP.c:1438: warning: useless type name in empty declaration
cc -c -I/usr/include -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -DVERSION=\"1.0.1\" -DXS_VERSION=\"1.0.1\" -fPIC "-I/usr/lib/perl/5.8/CORE" phpinterp.c
In file included from /usr/include/php5/main/php.h:34,
from phpinterp.h:11,
from phpinterp.c:13:
/usr/include/php5/Zend/zend.h:34:1: warning: "END_EXTERN_C" redefined
In file included from phpinterp.c:3:
/usr/lib/perl/5.8/CORE/perl.h:242:1: warning: this is the location of the previous definition
cc -c -I/usr/include -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -DVERSION=\"1.0.1\" -DXS_VERSION=\"1.0.1\" -fPIC "-I/usr/lib/perl/5.8/CORE" phpfuncs.c
In file included from /usr/include/php5/main/php.h:34,
from phpinterp.h:11,
from phpfuncs.c:5:
/usr/include/php5/Zend/zend.h:34:1: warning: "END_EXTERN_C" redefined
In file included from phpfuncs.c:2:
/usr/lib/perl/5.8/CORE/perl.h:242:1: warning: this is the location of the previous definition
phpfuncs.c: In function ‘zm_startup_sandwich’:
phpfuncs.c:1054: warning: assignment from incompatible pointer type
Running Mkbootstrap for PHP::Interpreter ()
chmod 644 Interpreter.bs
rm -f blib/arch/auto/PHP/Interpreter/Interpreter.so
cc -shared -L/usr/local/lib -L/usr/lib -L/usr/lib PHP.o phpinterp.o phpfuncs.o -o blib/arch/auto/PHP/Interpreter/Interpreter.so \
\
chmod 755 blib/arch/auto/PHP/Interpreter/Interpreter.so
cp Interpreter.bs blib/arch/auto/PHP/Interpreter/Interpreter.bs
chmod 644 blib/arch/auto/PHP/Interpreter/Interpreter.bs
Manifying blib/man3/PHP::Interpreter::Resource.3pm
Manifying blib/man3/PHP::Interpreter::Class.3pm
Manifying blib/man3/PHP::Interpreter.3pm
$
####
$ sudo make install
Installing /usr/local/lib/perl/5.8.8/auto/PHP/Interpreter/Interpreter.so
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/local/lib/perl/5.8.8/auto/PHP/Interpreter/.packlist
Appending installation info to /usr/lib/perl/5.8/perllocal.pod