I know about the phpinfo() way but is there any other way? I'm using CentOS and I can't find the httpd executable to run httpd -v.
For recent Apache versions, try this:
The output should be something like this:
The above check only includes the primary version number, not including the extended backport patches.
If you installed with yum you can:
and get the full version (note the -31 / -47)