List Info

Thread: Connecting to multiple databases in 5.x




Connecting to multiple databases in 5.x
user name
2006-12-29 17:52:37
Now that the settings.php file is write protected, the
instructions at http://drupal.org/node/1
8429 no longer work to connect to multiple 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
documentation on that page needs to be updated, too.

I posted a comment on http://drupal.org/node/6
4279, but I'm not sure that was the best place to put
it.

Karen

Connecting to multiple databases in 5.x
user name
2006-12-29 18:14:24
> Now that the settings.php file is write protected, the
instructions
> at http://drupal.org/node/1
8429 no longer work to connect to multiple
> 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
documentation
> 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 tell
us more about the permissions and ownership it created for
that file?

-- 
Morbus Iff ( is this a cut out bath-poster Morbus, or what?
)
Technical: http://www.oreil
lynet.com/pub/au/779
Culture: http://www.disobey.com/
and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff /
jabber.org: morbus
Connecting to multiple databases in 5.x
user name
2006-12-29 18:16:47
> The installer should be creating the file as writable.
Could you tell
> us more about the permissions and ownership it created
for that file?

See http://drupal.org/node/1
0658 and specifically the (in core for a 
while now) http
://drupal.org/files/issues/fileperm_0.patch. I haven't 
had a chance to check to see if this stuff has changed, or
what the 
installer is doing.

-- 
Morbus Iff ( were you a community theatre satan? )
Technical: http://www.oreil
lynet.com/pub/au/779
Culture: http://www.disobey.com/
and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff /
jabber.org: morbus
Connecting to multiple databases in 5.x
user name
2006-12-29 18:29:40
> See http://drupal.org/node/1
0658 and specifically the (in core for a 
> while now) http
://drupal.org/files/issues/fileperm_0.patch. I haven't 
> had a chance to check to see if this stuff has changed,
or what the 
> installer is doing.

Ah, interesting. The installer recommends that you do make
it read-only:

   // Warn about settings.php permissions risk
   $settings_file = './'. conf_path() .'/settings.php';
   if (!drupal_verify_install_file($settings_file, 
FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) {
     drupal_set_message(st('All necessary changes to %file
have been 
made, so you should now remove write permissions to this
file. Failure 
to remove write permissions to this file is a security
risk.', 
array('%file' => $settings_file)), 'error');
   }

So, my bad. I don't see why, however, you couldn't turn it
back to 
write, add your extra databases, then turn it back to read
only.

-- 
Morbus Iff ( I'd prefer my past to be multiple choice. )
Technical: http://www.oreil
lynet.com/pub/au/779
Culture: http://www.disobey.com/
and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff /
jabber.org: morbus
Connecting to multiple databases in 5.x
user name
2006-12-29 18:29:54
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 it
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 make
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/1
8429 should still work.

Morbus Iff wrote:
>> Now that the settings.php file is write protected,
the instructions
>> at http://drupal.org/node/1
8429 no longer work to connect to multiple
>> 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 documentation
>> 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 tell
> us more about the permissions and ownership it created
for that file?
> 
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )