In EL7 (RHEL+CentOS), as a security measure, Apache processes get a private /tmp/ directory [1]. As a result, this means that any Apache processes attempting to connect to postgresql using a domain socket will be unable to connect.
EL7 (and Fedora) address this problem by updating the following setting in postgresql.conf [2]