php_uname(); PHP_OS DIRECTORY_SEPARATOR PHP_SHLIB_SUFFIX PATH_SEPARATOR for example: if(PATH_SEPARATOR==':'){ echo 'Linux'; }else{ else echo 'Windows'; }