0

This is driving me nuts : I'm trying to compile a php extension for a library (www.phah.org), which compiles fine, but when I try to enable load it with php, I have the following warning (this is actually the output of make test):

PHP Warning:  PHP Startup: pHash: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20090626

The confusing thing is when i do phpize before compiling, it shows the right API version :

$ phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

But it is still compiled with 20100525 (php 5.4) instead of 220090626 (php 5.3). I spent quite some time searching, but I only found ppl having the opposite problem (extension compiling for an older version of php).

Any hints?

joseph-l
  • 91
  • 1
  • 6
  • And here is the list of my installed php packages: php-pear 5.3.10-1ubuntu3.9, php5 5.3.10-1ubuntu3.9, php5-cli 5.3.10-1ubuntu3.9, php5-common 5.3.10-1ubuntu3.9, php5-curl 5.3.10-1ubuntu3.9, php5-dev 5.3.10-1ubuntu3.9, php5-fpm 5.3.10-1ubuntu3.9, php5-gd 5.3.10-1ubuntu3.9, php5-mcrypt 5.3.5-0ubuntu1, php5-mysql 5.3.10-1ubuntu3.9 – joseph-l Mar 05 '14 at 16:08

1 Answers1

0

Well, I figured it out : instead of using the php bindings shipped with 0.9.6 sources, you can use either the 0.9.4 version from here https://github.com/sdepold/pHash, or this version as it is forked from 0.9.6, https://github.com/Alexis2004/php-phash Both compile just fine without the API version problem. looks like it doesn't come from Zend apparently.

joseph-l
  • 91
  • 1
  • 6
  • I am still getting the following error with https://github.com/Alexis2004/php-phash: Notice: Undefined variable: linedef in /usr/share/php/CodeGen/PECL/Element/Function.php on line 1345 [...] configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. [...] checking for pHash.h... yes checking audiophash.h usability... yes checking audiophash.h presence... yes checking for audiophash.h... yes checking for ph_texthash in -lpHash... no configure: error: wrong pHash lib version or lib not found – Paras Nath Chaudhary Apr 29 '14 at 09:46