Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28509 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46418 invoked by uid 1010); 21 Mar 2007 02:15:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46403 invoked from network); 21 Mar 2007 02:15:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2007 02:15:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=mba2000@ioplex.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mba2000@ioplex.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ioplex.com from 66.220.1.142 cause and error) X-PHP-List-Original-Sender: mba2000@ioplex.com X-Host-Fingerprint: 66.220.1.142 www.ioplex.com Linux 2.4/2.6 Received: from [66.220.1.142] ([66.220.1.142:1540] helo=www.ioplex.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/D1-20949-85590064 for ; Tue, 20 Mar 2007 21:15:54 -0500 Received: from quark.foo.net (c-69-142-196-170.hsd1.nj.comcast.net [69.142.196.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by www.ioplex.com (Postfix) with ESMTP id 43BDE42B70; Tue, 20 Mar 2007 22:15:49 -0400 (EDT) Date: Tue, 20 Mar 2007 22:15:47 -0400 To: Michael Wallner Cc: internals@lists.php.net Message-ID: <20070320221547.6369bf34.mba2000@ioplex.com> In-Reply-To: References: <20070319201618.082eac46.mba2000@ioplex.com> X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP version and Zend API Number From: mba2000@ioplex.com (Michael B Allen) On Tue, 20 Mar 2007 13:17:24 +0100 Michael Wallner wrote: > Michael B Allen wrote: > > Hi, > > > > Is there a way to get the version of the PHP binary that loaded an > > extension from within the extension? I don't mean the PHP version the > > extension was compiled with (PHP_VERSION), I mean the version of the > > PHP binary itself? > > > > Can I call the phpversion function from within an extension? > > > > Similarly is there a way to get the zend API version of the PHP binary > > (not the version the extension was compiled with)? > > mike@honeybadger:~/cvs/php-5.2$ grep -E 'version.*\);' Zend/*.h > Zend/zend_API.h:ZEND_API char *zend_get_module_version(char *module_name); > Zend/zend_extensions.h:void zend_append_version_info(zend_extension *extension); > Zend/zend.h:ZEND_API char *get_zend_version(void); > > > You could query ext/standard for the PHP version, everything else should be self explanatory. Yes, that does give me the PHP version. Thanks. The get_zend_version function returns a string like 'Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies\n'. It would be nice to be able to get the ZEND_MODULE_API_NO (e.g. 20060613) the standard module was compiled under. I'm still confused about how many versions of extensions I need to provide with my product. Currently I just compile it against late versions of 4, 5.0, 5.1 and 5.2 and hope for the best. But looking at ZEND_MODULE_API_NO changes in webcvs shows it changes more frequently than that. But so far I haven't ran into major problems with ZEND_MODULE_API_NO so maybe I'm just being paranoid. From looking at zend.c it looks like it will print diagnostic info if some tries to load an incompatible extension. Mike -- Michael B Allen PHP Active Directory Kerberos SSO http://www.ioplex.com/