Is there a place to find a list of the possible values for the PHP predefined constant PHP_OS
? I'd like to use this value for a system requirements check, but need to know how different operating systems are named in this variable.
Through some searching, so far I've compiled the following list:
If anyone has a more complete list, or knows of any additional values I'd love to hear them!
PHP passes through the uname, except on Windows (WINNT
) and Netware (Netware
). See Wikipedia for a non-exhaustive list of values not mentioned in your question:
I think a better solution to do a 'requirement check' would be to actually use things that you need to know work properly and see what happens.
For example, there are constants for directory separators, functions like realpath(), etc to deal with directories on different operating systems.
What, specifically, are you trying to do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With