Conditionally adds mysql socket path to php.ini

Implemented this before but wasn't conditional and threw notices when variable wasn't available in template. Hopefully this implementation is a bit more elegant.