0

We're preparing to get our Drupal infrastructure moved from PHP 5.6 to PHP 7.2. In order to start testing, I migrated a Drupal 7.67 multi-site from our current production server to a test server running PHP 7.2 and got one of the sites configured. So far, everything about the web site appears to work fine (visual, navigation, etc). Except that I can't log in!

When I navigate to /user/login, type my username and password, and click submit, there's evidence in the database that the login appears successful (users.login timestamp updates), and I'm redirected to /users/myusername, but it says "Access Denied" and doesn't show the top bar to change config, content, etc.

Drush appears to work fine for changing my password (upwd), creating one-time login links (uli), etc, but the login link doesn't work, instead showing "Access Denied" again.

I've checked just about everything you're supposed to check when issues like this come up:

  • Verified mod_rewrite is enabled
  • Tried with and without Base URL setting enabled in settings.php
  • Tried with and without RewriteBase setting in .htaccess
  • Tried with and without cookie_domain setting in settings.php
  • Cleared caches and truncated tables like cache*, flood, semaphore, sessions, watchdog
  • Made sure no database updates are pending
  • Restarted Apache periodically
  • Checked Apache error logs, nothing of note there
  • Tried multiple browsers from multiple computers, with and without Incognito modes

I have no idea what else to try, and sadly I'm not even sure if this is simply related to migrating the site from one server to another or whether it's because we moved from PHP 5.6 to PHP 7.2. Where do I begin troubleshooting this? Thank you in advance for your help!

  • It sounds like some heavy caching, do you have Memcache? Do you use CDN? Sometimes symptoms like that appear when caching has been misconfigured. Check your multisite config too, are you sure you're using appropriate databases etc? – prkos Jun 6 at 19:54
  • It looks like the title was changed, but Drupal 7 was removed. Isn't it crucially relevant to the question that it's a Drupal 7 site being migrated, and not a Drupal 8 site? We've already migrated Drupal 8 sites and didn't see these issues, but we're seeing them with a Drupal 7 site. – Hunter Buchanan Jun 6 at 19:55
  • @prkos I'm not familiar with Memcache. As far as the multisite config, everything looks to be working properly there, Drush shows that the correct database is being used, I can access/view the site without problems, etc. Caching is a good place to start, though. Maybe I'll turn off caching on the old site and try migrating it again. – Hunter Buchanan Jun 6 at 19:59
  • Did you set a custom cookie domain in a file and now that domain changed? – Kevin Jun 6 at 20:31
0

We found the problem. The site was using HTTPS on the production server and HTTP on the test server, and we had set php_flag session.cookie_secure On in our Apache config. HTTPS wasn't in use, so no cookies were sent, so no logins would work properly. Setting this to Off worked wonders. Thanks for pointing me in the right direction, folks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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