php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69781 phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as "Business"
Submitted: 2015-06-09 08:00 UTC Modified: 2015-06-10 19:53 UTC
From: wenz@php.net Assigned: ab (profile)
Status: Closed Package: PHP options/info functions
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
 [2015-06-09 08:00 UTC] wenz@php.net
Description:
------------
Microsoft changed the behavior of GetProductInfo with Windows 7 and upwards:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724358%28v=vs.85%29.aspx

Obviously due to maintain backwards compatibility, applications that were compiled to be compatible with Windows Vista report the Professional, Professional N, and Starter N editions of Windows as Business, Business N, and Starter. 

We could fix this by defining _WIN32_WINNT as 0x0600 or higher, but would then loose Windows Vista support. 

The pull request fixes that in a pretty straight forward way. There could be a more elaborate fix, since the "official" wording for the Professional editions from Windows 8 onwards is "Pro", but I'd say we leave it for now.

Bug #55319 reports a specific aspect of this bug, namely the "Business" instead of "Professional".

Test script:
---------------
<?php
  phpinfo(INFO_GENERAL);

Expected result:
----------------
Output contains "Windows 7 Professional" on a Windows 7 Professional machine.

Actual result:
--------------
Output contains "Windows 7 Business".

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-09 08:45 UTC] wenz@php.net
(might have messed up the PR since I was playing around with the web interface and syncing first, which showed up in the history. However the file changes are correct.)

I have also tested the patch with 5.6 and master, so that could be merged for those, too.
 [2015-06-09 08:45 UTC] wenz@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: ab
 [2015-06-10 00:13 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2015-06-10 00:13 UTC] cmb@php.net
Switched back to "open" to avoid the bug tracker to close the ticket prematurely. :)
 [2015-06-10 09:28 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0c8136654d59303750fa5dc20907bda0a6307ea7
Log: Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;
 [2015-06-10 09:28 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2015-06-10 09:28 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=82e5260104021076402430b1fabc8af99860104c
Log: Revert &quot;Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;&quot;
 [2015-06-10 09:28 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=741b949a6f7c3bc3e171622fe289ad2c0871f9cc
Log: Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;
 [2015-06-10 09:40 UTC] ab@php.net
@wenz can the related ticket be closed as well?

With _WIN32_WINNT - what do you mean? It is already 0x0600 as it corresponds to the targeting Vista, so how we would loose it? See main/config.w32.h and makefile for WINVER in CFLAGS.

Thanks.
 [2015-06-10 10:09 UTC] wenz@php.net
yes, this can be closed. Thanks for accepting the PR!

If we would set _WIN32_WINNT to 0x0601, GetProductInfo would return correct results, but then PHP would not run under Vista any longer, that's why we need to workaround. Sorry for the confusion! :)

I will still work on adding the remaining SKUs, probably next week. I have seen code that uses the phpinfo() output in weird ways, so the more accurate the details, the better ;-)
 [2015-06-10 19:53 UTC] ab@php.net
@wenz, thanks for working on this. If you see something to do more - yep, just do it. I'd have been probably already drowned in all that product types :)

With 0x0600 - we still can't drop the Vista support. I think you and me were not alone in willing that. But it's supported now, so has to stay.

I'm going to close the #55319 then.

Thanks.
 [2015-06-23 18:04 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0c8136654d59303750fa5dc20907bda0a6307ea7
Log: Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;
 [2015-06-23 18:04 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=82e5260104021076402430b1fabc8af99860104c
Log: Revert &quot;Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;&quot;
 [2015-06-23 18:04 UTC] ab@php.net
Automatic comment on behalf of christian@wenz.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=741b949a6f7c3bc3e171622fe289ad2c0871f9cc
Log: Fix #69781: phpinfo() reports Professional Editions of Windows 7/8/8.1/10 as &quot;Business&quot;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC