[development] Connecting to multiple databases in 5.x

Steven Peck speck at blkmtn.org
Fri Dec 29 21:28:44 UTC 2006

Chris submitted a patch to mention this change of behavior during the
install.  I spent about 5 minutes being very confused last week when I
came across this as well.


> -----Original Message-----
> From: development-bounces at drupal.org [mailto:development-
> bounces at drupal.org] On Behalf Of Karen Stevenson
> Sent: Friday, December 29, 2006 12:54 PM
> To: development at drupal.org
> Subject: Re: [development] Connecting to multiple databases in 5.x
> In windows at least, the file is actually made read-only and I never
> any status message telling me that. That's OK and makes sense, but was
> surprise when I tried to edit the file and couldn't. My concern was
> if I temporarily removed the read-only access and made my changes that
> was going to do something that would create big problems for me down
> road (i.e. that it was write-protected partly so that nothing on it
> get altered in any way, even by me). So at the very least, any
> that talks about making changes to the settings.php file from 5.x on
> should mention that the file may be write-protected but it is OK to
> the protection, make the changes, and re-protect it, since the fact
> it is read-only is going to scare others away from changing it.
> This came up because I have a module that needs a connection to an
> external database to work and my previous instructions to users were
> make that change in their settings file, but the fact that it is now
> write-protected might frighten them unnecessarily. I did it that way
> instead of asking them to input the database connection info on the
> settings page because I really don't like storing info like that in
> database.
> Anyway, if I don't have to worry about breaking something by making
> change, I can go back to doing it this way and document this in my
> INSTALL.txt file.
> Thanks!
> Karen
> ----- Original Message ----
> From: Chris Kennedy <chrisken at mail.utexas.edu>
> To: development at drupal.org
> Sent: Friday, December 29, 2006 12:29:54 PM
> Subject: Re: [development] Connecting to multiple databases in 5.x
> Settings.php is made read-only on install if possible (using
> drupal_verify_install_file). See http://drupal.org/node/105368 which
> adds a status message to clarify this (and needs a review). Or maybe
> would be better to have the read-only change be a checkbox on the
> install page that is enabled by default but can be disabled.
> Also keep in mind that Drupal gives incorrect error messages in some
> cases when settings.php is unreadable or doesn't exist. This might
> you think your database settings are wrong, when it is really a
> permissions issue. http://drupal.org/node/100476 fixes some of these
> cases (and needs a review).
> So, theoretically http://drupal.org/node/18429 should still work.
> Morbus Iff wrote:
> >> Now that the settings.php file is write protected, the instructions
> >> at http://drupal.org/node/18429 no longer work to connect to
> >> databases. I searched around but wasn't able to find anything on a
> >> recommended way to do this in 5.x. And, of course, the
> >> on that page needs to be updated, too.
> >
> > settings.php is not write-protected. More than likely:
> >
> >  * your webserver is a user and group that you don't have access to.
> >  * when the install.php wrote your settings.php for you, it was
> >    unable to give you proper permissions to write to the file.
> >
> > Drupal does not enforce write protection on the settings.php.
> > The above is still the right way of doing multiple databases.
> >
> > The installer should be creating the file as writable. Could you
> > us more about the permissions and ownership it created for that
> >

More information about the development mailing list