How to compile php extension for PHP 5.3.6 using debugging, TS

I tried to create some php extension.

For the first, I compiled php 5.3.6 with --enable-debug --enable-maintainer-zts . Then I paused the extension and used the standard procedure for it

 phpize ./configure --with-EXTNAME make 

Then copy extname.so to my php extension 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 the extension, I received a warning that these parameters are not recognized by the configure script.

So, how can I compile my extension for use with PHP compiled with the parameters I describe above without recompiling php itself?

+6
source share
2 answers

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

The configuration script probably uses a different php-config (probably set in the middle).

+6
source

there are 2 phpize on my server

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

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

 /usr/bin/php-zts/phpize ./configure --with-php-config=/usr/bin/php-zts/php-config make make install 
0
source

Source: https://habr.com/ru/post/891305/


All Articles