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
6:19 am Aug 11, 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
,
Jul
,
Jun
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
August 2026 Google Search Observations
AdSense Earnings and Observations - August 2026
Booking Feels Google AI Effects - Plans SEO decline
IbouBot
EU AI Transparency Rules Now in Effect
Do you still build external links in 2026?
July 2026 Google Search Observations
How has AI changed your work?
Home
Forums Index
Server Side
/
PHP Server Side Scripting
6:19 am Aug 11, 2026