It sounds like the webserver is running the site in a chroot
environment, so that what is reported as /etc/
by the webserver isn't the same /etc/
that is used the machine as a whole.
As for the php --version
reporting a different version, that likely means you have two separate versions of PHP installed. The web server is configured to use one (possibly again installed inside the chroot
environment), and the machine as a whole is running an entirely different copy outside of the web server.
Read more about chroot here: http://en.wikipedia.org/wiki/Chroot