These people are all crazy.
This is what all the pros do. My qualification: I was the lead of the secure sign on site for a major branch of the U.S. military:
In your apache vhost for each site you do something like this
<VirtualHost *:80>
ServerName www.phpexperts.pro
SetEnv SQL_HOST localhost
SetEnv SQL_USER phptutor
SetEnv SQL_PASS someRandom-234qasdfasPass
SetEnv SQL_DB rosettablog
</Virtualhost>
Then you run these commands on your vhost config file:
sudo chown root:root 29_phpexperts.pro.conf
sudo chmod 0600 29_phpexperts.pro.conf
What that does is set the user to root and the group to root and then sets file permissions to allow root to read and write it and apache only to read it. As long as apache is started by the root user, only root will then need to have read access to it (thanks @grossvogel).
In your code you do this:
$mysql_user = $_SERVER['SQL_USER'];
Voila! No plaintext password viewable to everyone on your system. Only viewable to apache and root. For kicks, you should encrypt it w/ your secret hash but that might be overkill for most instances.
The odds that someone will be in your root group are very small, and if they do, nothing exception encryption will slow them down much.
What's worse? A file readable by everyone and all they have to do is grep -i PASS * -R
or this system, where they have to hack either your root account or be able to write to your PHP server? In any case, they would have long-before gotten your password.
Also, the other way to do this is to set the creds (encrypted, hopefully) into APC and then unset the Apache var.