fuxia
fuxia

Reputation: 63606

How to detect current IIS version with PHP?

My approach now is …

if ( preg_match( '~IIS/(\d+\.\d+)~', $_SERVER['SERVER_SOFTWARE'], $matches ) )
    $version = $matches[1];

… but I have no experience with IIS, and after searching for a while I found no information how reliable that is. The server signature might be suppressed, or the pattern might be changed in older versions or by additional software.

Is it possible to detect the full correct IIS version with PHP? Maybe with the Windows only extensions? Are there any pitfalls I should be aware of?

Upvotes: 6

Views: 620

Answers (1)

mohammad mohsenipur
mohammad mohsenipur

Reputation: 3149

as I know the structure of IIS Version Is Fix like this

 Microsoft-IIS/5.0 (Windows 2000)
 Microsoft-IIS/5.1 (Windows XP)
 Microsoft-IIS/6.0 (Windows 2003 Server)

Upvotes: 1

Related Questions