0

This looks similar to

Drupal 7 keeps returning to install.php and reports no settings.php but it's all there

but I only just registered so can't comment.

This is a single site (still drupal 7.59). free_access is true, sites/defaults/settings.php is writeable by all (website on local machine to try to figure out solution.) Connection to mysql seems OK.

One clue: if I proceed to install, "Verify requirements" says things like:

The Drupal installer requires that the ./sites/default/default.settings.php file not be modified in any way from the original download.

yet from within the nginx root directory:

# ls -l sites/default/default.settings.php
-rw-r--r--  1 root  users  26250 May  3 15:53 sites/default/default.settings.php

so where does drupal look? (I didn't find a mention of the root directory in the database...)

7
  • I should probably have also stated the obvious: install.php is in the nginx root directory. Commented May 14, 2018 at 10:38
  • Did you changed the default.settings.php or is it at least in the directory ?
    – pbonnefoi
    Commented May 14, 2018 at 10:47
  • In my original question I show that default.settings.php is in the directory, and $ diff sites/default/default.settings.php /tmp/drupal-7.59/sites/default/default.settings.php shows no difference. Commented May 14, 2018 at 14:05
  • <?php define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); print_r(conf_path()); ?> outputs: "sites/default" Commented May 16, 2018 at 9:35
  • Do you have drush installed ? If so can you paste what "drush status" says ?
    – pbonnefoi
    Commented May 16, 2018 at 9:52

1 Answer 1

0

The script useful for tracking this down was:

<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
print_r(getcwd()); echo '<br>';
print_r(conf_path()); echo '<br>';
$settings_path = DRUPAL_ROOT . '/' . conf_path() . '/settings.php';
echo "settings_path: $settings_path<br>";
$ret = realpath($settings_path);
echo "ret: $ret<br>";
?>  

The clue was that $ret was empty. From the realpath documentation:

Note: The running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE.

Changing

drwxr-x---  3 root  users  512 May 16 14:34 default

to have world executable permission worked around the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.