Bug #69434 [Com]: php_uname('m') reports wrong machine type
| From: | walts at jtechmedical dot com | Date: | Mon, 28 Mar 2016 22:58:52 +0000 |
| Subject: | Bug #69434 [Com]: php_uname('m') reports wrong machine type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200193@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69434&edit=1
ID: 69434
Comment by: walts at jtechmedical dot com
Reported by: tm8544 at hotmail dot com
Summary: php_uname('m') reports wrong machine type
Status: Open
Type: Bug
Package: *General Issues
Operating System: Windows 7 x64
PHP Version: 5.6.7
Block user comment: N
Private report: N
New Comment:
I'm also seeing php_uname() reporting the wrong machine information
example output from php_uname()
Windows NT ELITE800 6.2 build 9200 (Windows 8 Professional Edition) i586
vs as reported from the substring in the user agent
Windows NT 10.0; WOW64
Machine is actually Windows NT 10.0; WOW64 so it seems something isn't reporting or parsing
correctly in php_uname().
Previous Comments:
------------------------------------------------------------------------
[2015-04-13 09:24:01] ab@php.net
IMHO this shouldn't be changed. AMD64 is historically a synonymous for any 64-bit architecture.
This is a common terminology, on Windows it's a standard keyword, on some Linux distros (fe
Gentoo) as well.
Thanks.
------------------------------------------------------------------------
[2015-04-13 08:34:12] krakjoe@php.net
To change it would be a considerable BC break though, http://lxr.php.net/xref/PHP_TRUNK/ext/standard/info.c#php_get_windows_cpu
has been like that for a long time.
Not sure what is the best thing to do, it would be nice if they were consistent with each other, but
I don't see a good way to actually do it.
------------------------------------------------------------------------
[2015-04-13 08:18:06] derick@php.net
I believe it should return x86_64 - like it does on Linux:
php -r 'echo php_uname("m");'
x86_64
------------------------------------------------------------------------
[2015-04-13 07:58:56] tm8544 at hotmail dot com
SYSTEM_INFO structure
PROCESSOR_ARCHITECTURE_AMD64 stands for x64 (AMD or Intel)
I suggest that instead of reporting "AMD64" PHP_uname('m') would report
"x64".
------------------------------------------------------------------------
[2015-04-13 07:17:13] tm8544 at hotmail dot com
Description:
------------
PHP_uname('m') gives wrong machine type.
In my case, processor is Intel Pentium 4, but PHP_uname('m')gives AMD64.
Test script:
---------------
<?php
echo php_uname('m');
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69434&edit=1