Search code examples
phpphp-extension

How to compile php extension for PHP 5.3.6 with debug, TS


I've tried to create some php extension.

For the first I compiled php 5.3.6 with --enable-debug --enable-maintainer-zts. Then I ceated my extension and use standart procedure for it

phpize
./configure --with-EXTNAME
make

Then copy extname.so to my php extensions directory, and change php.ini

And when I try to use php from cli I got an error

Unable to initialize module
Module compiled with build ID=API20090626,NTS
PHP    compiled with build ID=API20090626,TS,debug

When I try

./configure --enable-debug --enable-maintainer-zts

For extension I got warning that these options are not recognized by configure script.

So, how can I compile my extension to use with PHP compiled with options that I describer above without recompiling php itself?


Solution

  • You need ./configure --with-php-config=/path/to/correct/php-config.

    The configure script is likely using another php-config (likely the centrally installed one).