|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56701 ZEND_EXTENSION_API_NO not set (missing zend_extensions.h)
Submitted: 2005-12-06 06:25 UTC Modified: 2006-01-03 16:04 UTC
From: akorthaus at web dot de Assigned:
Status: Closed Package: Fileinfo (PECL)
PHP Version: 5_1 CVS-2005-12-06 OS: Linux 2.4.32 (gentoo)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
15 - 8 = ?
Subscribe to this entry?

 [2005-12-06 06:25 UTC] akorthaus at web dot de
The latest commit to fileinfo.c (1.13) introduces a new compile problem:

ZEND_EXTENSION_API_NO is not set here, so you allways use "intern->zo.in_get", but in my enviroment (php-5.1.1) the struct has no member named 'in_get'.

The following patch solves the issue for me, but perhaps there is a better way:

--- fileinfo.c  6 Dec 2005 00:27:01 -0000       1.13
+++ fileinfo.c  6 Dec 2005 11:21:46 -0000
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "php.h"
+#include "zend_extensions.h"

 #include <magic.h>

Reproduce code:
pecl install fileinfo

Expected result:
should install fileinfo-1.0.2

Actual result:
make fails:

 gcc -I. -I/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2 -DPHP_ATOM_INC -I/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/include -I/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/main -I/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2 -I/usr/lib/php5/include/php -I/usr/lib/php5/include/php/main -I/usr/lib/php5/include/php/TSRM -I/usr/lib/php5/include/php/Zend -I/usr/lib/php5/include/php/ext -DHAVE_CONFIG_H -O2 -march=pentium3 -fomit-frame-pointer -c /var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/fileinfo.c  -fPIC -DPIC -o .libs/fileinfo.o
/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/fileinfo.c: In function `finfo_objects_new':
/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/fileinfo.c:109: error: structure has no member named `in_get'
/var/tmp/portage/pecl-fileinfo-1.0.2/work/Fileinfo-1.0.2/fileinfo.c:110: error: structure has no member named `in_set'
make: *** [fileinfo.lo] Error 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-06 06:28 UTC] akorthaus at web dot de
my API versions (from phpize):

PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025

I replaced ZEND_EXTENSION_API_NO with 220051025 in the source which made it work. My zend_extensions.h defines END_EXTENSION_API_NO with 220051025.
 [2005-12-16 01:50 UTC] ruanchunping at gmail dot com
thank you!
i meet the same problem.
 [2005-12-16 08:09 UTC] akorthaus at web dot de
Ilia recommended another solution:
 [2005-12-22 17:08 UTC] popefelix at gmail dot com
The patch from Ilia (reproduced below for convenience) fixed it for me.
 [2005-12-22 17:09 UTC] popefelix at gmail dot com
oh yeah, the patch:

Index: fileinfo.c
RCS file: /repository/pecl/fileinfo/fileinfo.c,v
retrieving revision 1.13
diff -u -p -a -d -r1.13 fileinfo.c
--- fileinfo.c	6 Dec 2005 00:27:01 -0000	1.13
+++ fileinfo.c	6 Dec 2005 04:14:55 -0000
@@ -103,7 +103,7 @@ PHP_FILEINFO_API zend_object_value finfo
 	intern = ecalloc(1, sizeof(struct finfo_object));
 	intern->zo.ce = class_type;
 	intern-> = NULL;
-#if ZEND_EXTENSION_API_NO > 220050000
+#if ZEND_MODULE_API_NO >= 20050922
 	intern->zo.guards = NULL;
 	intern->zo.in_get = 0;
 [2006-01-03 16:04 UTC] ilia at prohost dot org
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 12:01:29 2024 UTC