php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16259 Windows version info in binaries
Submitted: 2002-03-25 09:01 UTC Modified: 2002-04-11 14:00 UTC
From: Vladimir dot Michl at hlubocky dot del dot cz Assigned: jtate (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Vladimir dot Michl at hlubocky dot del dot cz
New email:
PHP Version: OS:

 

 [2002-03-25 09:01 UTC] Vladimir dot Michl at hlubocky dot del dot cz
Hello,

I see, that windows binaries of PHP does not include version info. It is useful, if people want discover, what version have on disk, without running php with phpinfo() function.

Resource file (php.rc) may be (if not included correctly email me):
--------------------------------------------------------
#include <winver.h>

#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)

VS_VERSION_INFO VERSIONINFO
  FILEVERSION MAJORVER,MINORVER,RELEASEVER,BUILDNUMBER
  PRODUCTVERSION MAJORVER,MINORVER,RELEASEVER,0
  FILEFLAGSMASK 0
  FILEFLAGS 0
  FILEOS VOS__WINDOWS32
  FILETYPE VFT_DLL
  FILESUBTYPE VFT2_UNKNOWN
  BEGIN
    BLOCK "StringFileInfo"
    BEGIN
      BLOCK "040904B0"
      BEGIN
	VALUE "CompanyName", "PHP Team"
	VALUE "FileDescription", "PHP Script interpreter"
	VALUE "FileVersion", STRVER4(MAJORVER, MINORVER, RELEASEVER, BUILDNUMBER)
	VALUE "InternalName", "php"
	VALUE "LegalCopyright", "Copyright ? 2002 PHP Team"
	VALUE "OriginalFilename", "php"
	VALUE "ProductName", "php"
	VALUE "ProductVersion", STRVER3(MAJORVER, MINORVER, RELEASEVER)
        VALUE "URL", "http://www.php.net"
      END
    END
    BLOCK "VarFileInfo"
    BEGIN
      VALUE "Translation", 0x409, 1200
    END
  END
-----------------------------------------------------------

Under mingw this may be compiled into .o file:

windres -DMAJORVER=$(MAJORVERSION) -DMINORVER=$(MINORVERSION) -DRELEASEVER=$(RELEASEVERSION) -DBUILDNUMBER=$(BUILDNUMBER) php.rc php-win32res.o

If this .o file is linked into php.exe and all dlls, all this files will have version info.

Under MSVC:
rc -r /dMAJORVER=1 /dMINORVER=1 /dRELEASEVER=1 /dBUILDNUMBER=1 php.rc

create php.res file, which may be linked into php.exe and all dlls for version info.

Macros MAJORVER, MINORVER, RELEASEVER and BUILDNUMBER must be specified on command line to resource compiler for include PHP version to resource file.

To version info version is created as MAJORVER.MINORVER.RELEASEVER.BUILDNUMBER

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-09 18:07 UTC] jimw@php.net
recategorizing as a change request.
 [2002-04-09 20:08 UTC] yohgaki@php.net
PHP 4.2.0 has PHP_VERSION constant
phpversion() is there for long time.

Reopen if you are talking about other feature.
 [2002-04-09 20:26 UTC] yohgaki@php.net
Oops you are talking about os version.
You can use "uname" if you use cygwin.
(All unix and Mac OS X have that)

Or you can check it with w32api, I suppose.












 [2002-04-09 20:37 UTC] wez@php.net
He means version info a in Version Info Resource.
(Right click on php.exe, properties, Version tab).
Re-opening as this is a valid feature request.
Can one of the windows build guys add this into the
relevant projects?
It will need doing for cgi, cli and isapi DLLs, as well
as the php4ts.dll.
 [2002-04-10 10:45 UTC] jtate@php.net
I'm on it.  It'll be in CVS today.
 [2002-04-10 14:01 UTC] jtate@php.net
I've added version resources to php4tsdll, php4isapi, php4ts and php4ts_cli projects.  I'm waiting for my patch for configure.in and main/php_version.h to go through before I can commit this change.
 [2002-04-11 14:00 UTC] jtate@php.net
This bug has been fixed in CVS.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 05:01:31 2024 UTC