|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67407 Windows 8.1/Server 2012 R2 reported as Windows 8/Server 2012
Submitted: 2014-06-10 08:39 UTC Modified: 2014-07-08 08:01 UTC
From: Assigned: ab (profile)
Status: Closed Package: PHP options/info functions
PHP Version: master-Git-2014-06-10 (Git) OS: Windows 8.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2014-06-10 08:39 UTC]
The phpinfo() output on Windows 8.1 and Windows Server 2012 R2 reports the OS as Windows 8 and Windows Server 2012.

This is due to the deprecation of GetVersionEx (which we are using) on these platforms -

Once we compile the Windows builds with the Visual Studio 2013 compiler and the Windows 8.1 SDK, _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_LATEST) seems to help. However until then we need a different approach. 

VerifyVersionInfo ( looks like the best solution to me. It is slower than GetVersionEx, so we should only run it if we detect Windows 8/Server 2012 and then need to decide whether it's 8.1/2012 R2 instead. The attached patch proposes an implementation. 

Test script:

Expected result:
Output contains "Windows 8.1" on a Windows 8.1 machine.
Output contains "Windows Server 2012 R2" on a Windows Server 2012 R2 machine.

Actual result:
Output contains "Windows 8" (and not 8.1) on a Windows 8.1 machine.
Output contains "Windows Server 2012" (and not R2) on a Windows Server 2012 R2 machine.


detect-Win81-Server2012R2 (last revision 2014-06-10 08:40 UTC by

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-10 08:40 UTC]
The following patch has been added/updated:

Patch Name: detect-Win81-Server2012R2
Revision:   1402389611
 [2014-07-08 08:01 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2014-07-08 08:01 UTC]
Merged in 4883a60bb3412e5c776153703d7e0ff0a490482b , also backported into 5.4+
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 11:01:26 2023 UTC