install.php displayed instead of update.php This looks similar to

Drupal 7 keeps returning to install.php and reports no settings.php but it&#39;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...)
The script useful for tracking this down was:

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


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.