One of the most frustrating things about using third party scripts to developing in PHP is the fact that litterally none of them check for the operative system. PHP is pretty universal but there are many things which differ or are dependant on a particular server operative system.
To find the server os there is the predefined constants [1]. I often use this for determining between Windows and all others:
<?php
if (stristr(php_os, 'WIN')) {
// Win
} else {
// Other
}
?>
Simple and easy. While you are at it you may want to read up on the many built-in constants and functionality of PHP it will save you loads of time in the future.