Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out the version of HTTP in a request using PHP and Apache

I need to determine whether an HTTP request was an HTTP/1.0 or an HTTP/1.1 request in my PHP script, which is running under Apache. Is there a way to query this information?

like image 706
nohat Avatar asked Apr 21 '10 21:04

nohat


1 Answers

$_SERVER['SERVER_PROTOCOL'] as at $_SERVERDocs:

'SERVER_PROTOCOL'
Name and revision of the information protocol via which the page was requested; i.e. 'HTTP/1.0';

See as well:

  • Find out HTTP method in PHP
like image 85
brian_d Avatar answered Sep 21 '22 09:09

brian_d