I\'d like to automatically change my database connection settings on a per-vhost basis, so that I don\'t have to edit any PHP code as it moves from staging to live and yet a
Did you tried to use the .htaccess file? You could override the php.ini values using it.
Just put the .htaccess file into your htdocs directory:
php_value name value
Futher information: