PHP Classes

PHP OS Class: Determine the server operating system type

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 104 All time: 9,732 This week: 258Up
Version License PHP version Categories
php-os-class 1.0MIT/X Consortium ...5PHP 5


This is a simple class that can determine the server operating system type.

It looks at the PHP_OS_FAMILY environment variable and parses it to determine what operating system the server on which PHP is running.

Currently it can determine if the operating system type is of Windows, BSD, Linux and Solaris.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84411 in Pakistan Pakistan
Week rank: 280 Up6 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x



require_once 'classes/OperatingSystem.php';

$os = new OperatingSystem();



php OperatingSystem class


This class return the operating system of php server (where php is installed)

  Files folder image Files  
File Role Description
Files folder imageclasses (1 file)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file Data Auxiliary data

  Files folder image Files  /  classes  
File Role Description
  Plain text file OperatingSystem.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,732
This week:258Up