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

2

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?

Allure answered 24/6, 2011 at 17:22 Comment(0)
F
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).

Fresnel answered 24/6, 2011 at 17:25 Comment(1)
Oh... And where can find right php-config? I guess it is near the php in the bin directory, am I right?Allure
C
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 
Crosse answered 27/3, 2013 at 8:21 Comment(1)
Note only pick the correct phpize isn't enough: --with-php-config is required too.Calibre

© 2022 - 2024 — McMap. All rights reserved.