0

I know this question has been asked/answered on this site multiple times, But my question is a little diffrent. I have already reviewed some of those posts and what I got from there is :

 <?Php echo apache_get_version();?> 

I know this function returns the Apache version.

My website is on a free webhost eu5.org where they have disabled both phpinfo() and apache_get_version() And because of this I am not able to know which version I am using.

Is there any other way to get the server version in php?

Thanks!

4
  • simply type localhost in your url,click phpinfo() Commented Jun 5, 2015 at 9:05
  • 1
    Contact them and ask them. Commented Jun 5, 2015 at 9:06
  • Maybe something like shell_exec('apache2 -v'); Commented Jun 5, 2015 at 9:07
  • @whyte624 i doubt free hosting will allow shell_exec() or exec() Commented Jun 5, 2015 at 9:18

2 Answers 2

2

This Gist provides probably the best fallback I've seen if the apache_get_version function is disabled.

Basically you need to define a function that uses the operating system to call the httpd daemon directly to get the version information. Although, in your situation, it's likely that OS commands are also disabled so this might not be terrible helpful.

Sign up to request clarification or add additional context in comments.

Comments

2

if you cannot use php_info and apache_get_version functions you can try this one:
echo $_SERVER['SERVER_SOFTWARE'];

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.