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
I would not set an environment variable, as this is also visible in default script outputs like PhpInfo();
just use a php_value in your .htaccess just above the htdocs folder and you're done and safe :)