The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Can someone please tell me why I get an undefined function error when running this code in the functions.php? I want to query the server for the Apache version without getting the long string you get using SERVER_SOFTWARE.
PHP Code:
|
#2
|
||||
|
||||
![]()
apache_get_version() is only available in PHP version > 4.3.2, so this might be the cause.
Try this snippet: PHP Code:
|
#3
|
||||
|
||||
![]()
Thank you, sir. That worked great!
![]() The server I am on is running PHP v4.3.3. I'm not sure why that code I posted doesn't work. It should have. :surprised: Is there also a way to get the version of UNIX or Linux (as my server has)? |
#4
|
||||
|
||||
![]()
Is apache running as a module or as CGI? As apache_get_version() only works if its run as a module.
|
#5
|
||||
|
||||
![]()
You got me on that one. I have no idea which way they have it set up. Apparently, it must be set up as CGI since the script gives me the unknown function error, right?
![]() Also, is there a way to pull the Linix version number out, too? |
#6
|
||||
|
||||
![]()
Apache as a module is the better method to use, take a look at the Server API part of phpinfo() at the very top and it should say Apache if your running it as a module.
For the Linux version info, provided you can run shell_exec() you can get the OS info with: PHP Code:
Quote:
![]() |
#7
|
||||
|
||||
![]()
Is there such a thing as this for the Linux version?
#1 SMP Mon Aug 18 14:34:09 EDT 2003 That's what it returns. I only have this info displayed for Admins. It is not available to the other users. ![]() The Server API just says Apache. |
#8
|
||||
|
||||
![]()
If you mean the Linux Kernel version then uname -r is what you want.
I've just tired apache_get_version(); on my server and it seems to work correctly for me with the Server API as Apache (ie a module), however, I think what you get returned from that is the same as you'll get from getenv('SERVER_SOFTWARE'); as both return Apache for me as I've set it to not show any other details in httpd.conf. |
#9
|
||||
|
||||
![]()
It must be running as CGI on my server then. That would explain why I get the error. The code KirbyDE posted above gave me just the version number of Apache and nothing else. That's all I needed as I already have the other info.
I tried the -r and this is what I got: 2.4.20-20.7smp Does that look right to you? What does the smp stand for? What is the exact code you used with this? apache_get_version(); |
#10
|
||||
|
||||
![]()
Yes, that looks right
![]() I just did: PHP Code:
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|