Ask a Question related to PHP Development, Design and Development.
-
Paul Kirby #1
Display Apache version in PHP?
Hello All
I am just asking if it is possible to get the apache version installed on
the server in PHP.
If this is possible can somebody tell me what function or code is I have to
use to do this.
Thanks in advance.
Paul Kirby
Paul Kirby Guest
-
#40728 [NEW]: configure won't identify apache version
From: sheezes at gmail dot com Operating system: AIX 5.3 PHP version: 5.2.1 PHP Bug Type: *Compile Issues Bug description: ... -
Apache Version With ColdFusion
Hi , I am new to Cold Fusion. Can one of you please let me know the support matrix for Apache and ColdFusion. I wanted to know what version of... -
ColdFusion MX 7 Apache Axis Version
Does anyone know what version of Apache Axis ColdFusion MX 7 is using? Jeff -
#21220 [Opn->Csd]: Wrong Apache version in phpinfo() shown
ID: 21220 Updated by: sniper@php.net Reported By: psychosos at gmx dot at -Status: Open +Status: ... -
Apache::MP3 fails to display playlists
Red Hat Linux 7.0 Apache 1.3.12 mod_perl 1.28 Apache::MP3 3.04 Apache::MP3::Playlist is failing to display playlists when I connect to the web... -
johannes m.r. #2
Re: Display Apache version in PHP?
It depends of your Apache configuration (ServerTokens)
You might find it in $_SERVER["SERVER_SIGNATURE"]
HTH
j.
johannes m.r. Guest
-
Paul Kirby #3
Re: Display Apache version in PHP?
"johannes m.r." <psychosos@gmx.at> wrote in message
news:3pqemvo7r0kek728lpisvna5kp3s9lv3cv@4ax.com...Thanks for replying.> It depends of your Apache configuration (ServerTokens)
> You might find it in $_SERVER["SERVER_SIGNATURE"]
> HTH
> j.
That returns the version but also the modules as well.
I just want the version.
Like it displays in phpinfo()
Thanks in advance
Paul Kirby
Paul Kirby Guest
-
sam #4
Re: Display Apache version in PHP?
$_SERVER['SERVER_SOFTWARE']
should contain something like this:
Apache/2.0.40 (Red Hat Linux)
SO:
$ar = split("[/ ]",$_SERVER['SERVER_SOFTWARE']);
$apache_version = $ar[1];
HTH
"Paul Kirby" <admin@initcorp.co.uk> wrote in message
news:bk7h4l$fhe$1$8302bc10@news.demon.co.uk...to> Hello All
>
> I am just asking if it is possible to get the apache version installed on
> the server in PHP.
>
> If this is possible can somebody tell me what function or code is I have> use to do this.
>
> Thanks in advance.
>
> Paul Kirby
>
>
sam Guest
-
Paul Kirby #5
Re: Display Apache version in PHP?
"sam" <rbaba99@caramail.com> wrote in message
news:bk7tk1$1irn$1@news.cybercity.dk...Thanks that worked a treat :)> $_SERVER['SERVER_SOFTWARE']
>
> should contain something like this:
>
> Apache/2.0.40 (Red Hat Linux)
>
> SO:
> $ar = split("[/ ]",$_SERVER['SERVER_SOFTWARE']);
> $apache_version = $ar[1];
>
> HTH
>
I ended up using the following:
$ar = split("[/ ]",$_SERVER['SERVER_SOFTWARE']);
for ($i=0;$i<(count($ar));$i++)
{
switch(strtoupper($ar[$i]))
{
case 'APACHE':
$i++;
$Apache_Version = $ar[$i];
break;
case 'PHP':
$i++;
$PHP_Version = $ar[$i];
break;
case 'MOD_SSL':
$i++;
$MOD_SSL_Version = $ar[$i];
break;
case 'OPENSSL':
$i++;
$OPENSSL_Version = $ar[$i];
break;
}
}
Echo "Apache Version: $Apache_Version<br>\n";
Echo "PHP Version: $PHP_Version<br>\n";
Echo "mod_ssl Version: $MOD_SSL_Version<br>\n";
Echo "OpenSSL Version: $OPENSSL_Version<br>\n";
That way all I have to do is add another case if I want to add another
version variable :)
Thanks
Paul Kirby
Paul Kirby Guest
-
johannes m.r. #6
Re: Display Apache version in PHP?
>I just want the version.
If you think about the string returned in the "Apache version" row>
>Like it displays in phpinfo()
under "apache" - it's not that Apache Version, but the version of
Apache php4apache.dll was compiled with.
(see [url]http://bugs.php.net/bug.php?id=21220[/url])
For example, I use Apache 1.3.28 right now but phpinfo() displays
1.3.24
Just FYI :)
j.
johannes m.r. Guest
-
Unregistered #7
Re: Display Apache version in PHP?
function versaoServer(){
$version = explode("/", $_SERVER['SERVER_SOFTWARE']);
$softNum = explode(" ", $version[1]);
$soft = $version[0].'/'.$softNum[0];
echo $soft;
}Unregistered Guest



Reply With Quote

