You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The majority of PHP installations are compiled with support for 64-bit values, but there is still a considerable amount of environments out there that only support 32-bit values for whatever reason. Defining support for 64-bit values in the system requirements of a software is the obvious choice here, but revealed an important shortcoming: The support int size isn’t documented in the phpinfo().
This is a problem for the average user because they cannot tell that themselves unless they run a script that compares against \PHP_INT_SIZE. The difference here to all other system requirements like installed PHP extensions or configuration settings is that those are visible through the phpinfo() output.
It could be helpful to include some sort of an indication of the int size, be it the raw value of \PHP_INT_SIZE or a more “human friendly” readout like “32-bit”.
This appears to be not reliably present. For comparison I have looked up the live phpinfo() examples for PHP 8.2 from both Host Europe and Hetzner. None of them show the architecture and the only reference to 64-bit at all is found in both the “System” and “Build System” strings but neither of that is a reliable indicator if it is 32-bit or 64-bit build of PHP. Please feel free to correct me if I’m wrong here.
That is clearly some useful information, but I don’t think this overlaps with the issue at hand. Frankly speaking, build providers are often times some small shared hosting companies that I like to describe with a lot of adjectives and none of them include “competent”.
I’m arguing entirely from the perspective of an ISV that has to deal with N customers hosting on N+1 different providers. The maximum supported integer size is something that is known to PHP at this point so there is already a reliable source of truth that does not depend on the build provider at all.
Activity
remicollet commentedon Sep 12, 2023
Can't you use
PHP_BUILD_ARCH?It is commonly used on Linux
dtdesign commentedon Sep 12, 2023
This appears to be not reliably present. For comparison I have looked up the live phpinfo() examples for PHP 8.2 from both Host Europe and Hetzner. None of them show the architecture and the only reference to 64-bit at all is found in both the “System” and “Build System” strings but neither of that is a reliable indicator if it is 32-bit or 64-bit build of PHP. Please feel free to correct me if I’m wrong here.
remicollet commentedon Sep 12, 2023
Indeed, Architecture and other helpers useful for support are to be set by the build provider
Perhaps you should ask these providers to set them properly?
Else, this seems very specific to Windows
dtdesign commentedon Sep 12, 2023
That is clearly some useful information, but I don’t think this overlaps with the issue at hand. Frankly speaking, build providers are often times some small shared hosting companies that I like to describe with a lot of adjectives and none of them include “competent”.
I’m arguing entirely from the perspective of an ISV that has to deal with N customers hosting on N+1 different providers. The maximum supported integer size is something that is known to PHP at this point so there is already a reliable source of truth that does not depend on the build provider at all.
Show the integer size in phpinfo() (#12201)