Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
2:27 am May 23, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
Detect the server's OS
Jakotsu
Msg#:3415991
5:15 pm on Aug 7, 2007
(gmt 0)
Hi,
Is there some function to guess if the server is running under Linux or Windows? Thanks!
d40sithui
Msg#:3415994
5:22 pm on Aug 7, 2007
(gmt 0)
try this
echo $_SERVER['SERVER_SOFTWARE'];
whoisgregg
Msg#:3416789
1:44 pm on Aug 8, 2007
(gmt 0)
Anytime you need to know something about the server that is running PHP,
check out the predefined variables manual page
[php.net]. :)
coopster
Msg#:3417899
1:53 pm on Aug 9, 2007
(gmt 0)
For server OS there is also the
predefined constants
[php.net]. I often use this for determining between Windows and all others:
if (
stristr
[php.net](PHP_OS, 'WIN')) {
// Win
} else {
// Other
}
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AI visibility audit
AdSense Earnings and Observations - May 2026
Page indexed but live url test gets 500 error
AI Generated Content vs Human Written Content: What Does Google Prefer
Early Observations on UCP and the Direction of SEO
in case you missed it .
Hacker spoofing as GoogleBot
Adsense / Personal Manager / Support
Google I/O 2026: Impact on Directory Sites & Google-Extended Policy?
Home
Forums Index
Server Side
/
PHP Server Side Scripting
2:27 am May 23, 2026