7

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?

Artefacto
  • 96,375
  • 17
  • 202
  • 225
krasilich
  • 643
  • 2
  • 9
  • 14

2 Answers2

7

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).

Artefacto
  • 96,375
  • 17
  • 202
  • 225
  • Oh... And where can find right php-config? I guess it is near the php in the bin directory, am I right? – krasilich Jun 24 '11 at 17:33
1

in my server there are 2 phpize

  /usr/bin/php/phpize
  /usr/bin/php-zts/phpize

to make sure it compiled with Thread Safety instead using "phpize" do

/usr/bin/php-zts/phpize
./configure --with-php-config=/usr/bin/php-zts/php-config
make
make install 
ewwink
  • 18,382
  • 2
  • 44
  • 54