How to find out installed version of APR?
Write one line of C :
# cat apr.c
int main(void) {
printf("%s\n",apr_version_string());
}
Compile (find the good path to your libapr)
# gcc -o apr apr.c /usr/pkg/lib/libapr-1.a
execute
# ./apr
1.3.3
PS: to find libapr you can try
ls /usr/lib/libapr*; ls /usr/local/lib/libapr*;ls /lib/libapr*;locate libapr; ...
or run ldd over httpd as david says if you want to find the version used by apache
You don't provide much information, but there are several methods you could try.
- Ask your package manager. This assumes that you have a system wide libapr installed via your package management system. Debian would be
dpkg -l "*apr*"
. RPM would be something likerpm -qa | grep -i apr
. - Of course, you might have installed it from source, in which case the library might have the version number encoded in the file name. Run
locate libapr
and it should show something like "/usr/lib/libapr-1.2.3.so" - Maybe that didn't find it. Try
ldd /usr/sbin/httpd
(or what ever your APR using binary is) and you'll see what library file your binary will use. This should also show the version number, or will show the location of a symlink to the file with a version number in the name. - Finally, it's possible that your binary has APR statically linked in. You can tell if ldd above didn't have APR in the list. You might be able to get a version number by running
strings /usr/sbin/httpd
and looking through for a version number that looks likely. You could also do this if you don't have a .so file with the version number encoded into it.
$ find / -name *apr* 2>/dev/null 1>/tmp/apr-findings
$ less /tmp/apr-findings
This helped me, because it was so bad documented. I don't know any nicer solution.
If you find a file named libapr*.la
and you cannot figure out its version number, look into it.
In my case it's something like this:
# Version information for libapr-0.
current=9
age=9
revision=4
On windows platform, check this file on apache bin folder: apr-1-config.pl
Specifically, the apr version string is stored at this line: my ${APR_DOTTED_VERSION} = q[1.4.5];
So, 1.4.5 is your current apr version
If you're just trying to find out what version is linked with Apache, /usr/local/apache2/bin/httpd -V will tell you.