Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

A site I manage has just become inaccessible to the admin today. I just updated apache on the server to enable mod_deflate and also to upgrade PHP from 5.3 to 5.4.

Since doing that every time I attempt to access /wp-admin/ I receive the redirect loop error. I tried all the usual suspects, i.e:

  • cleared cookies and cache
  • tried different browsers
  • disabled theme
  • disabled cookies
  • deleted .htaccess
  • checked site_url etc in wp_options

But no luck. I can access wp-login.php fine but not /wp-admin/

Any help would be greatly appreciated as I am totally stumped.

share|improve this question
    
Have you recently moved wordpress? –  Howdy_McGee Nov 12 '13 at 15:10
    
where are you redirected to? do you have errors in the php log? what happens if you disable mod_deflate?. frankly I find it unlikely that any of those changes will cause that, are you sure you haven't done anything else? –  Mark Kaplun Nov 12 '13 at 15:25
    
@Howdy_McGee - no, the site has been in the same location for the last few years. The only real change has been the PHP version today which seemed to trigger the issue. I'm not receiving any errors though. –  Joe Spurling Nov 12 '13 at 15:25
    
@MarkKaplun - I know it seems extremely unlikely but apart from updating Apache (and the only change there was the addition of mod_deflate) and the PHP version update I'm not aware of making any other changes. –  Joe Spurling Nov 12 '13 at 15:26
1  
then it is your php upgrade, not sure how but that is probably a new library being used in PHP 5.4. maybe this is not the best place to get help any longer and the regular stackexchange will be better –  Mark Kaplun Nov 12 '13 at 15:57

2 Answers 2

Try renaming the plugins folder to e.g. plugins-, so as to make sure it has nothing to do with them. Switch it back if it's not the case. If it was, proceed to do similar steps with each individual plugin folder until you locate the culprit.

The same for themes if you're still out of luck.

Another thing, per the comment, would be if the URLs are wrong. Say, the server wants www. and WP doesn't. Or the server wants SSL admin and WP doesn't. Or vice versa in each case. Those can very much break a site and trigger infinite redirects all over the place, so be sure to check those too. Adjust the WP config as appropriate using the relevant defines if needed: WP_HOME, WP_SITEURL, FORCE_SSL_ADMIN, FORCE_SSL_LOGIN.

If all else fails, the usual approach to debug this kind of stuff to die(__FILE__':'.__LINE__); your way throughout WP until you nail down what is causing the infinite loop. (It could be a cron job or some odd thing like that.)

By following the script, I mean opening up the wp-admin/index.php file (which in this case is the one getting hit), and inserting die(__FILE__':'.__LINE__); towards the top — before WP actually does anything. If it's already redirecting there, it means there's a problem with the server configuration.

If not, proceed to move the statement down step by step until the redirect occurs. Move further up, entering the included files and the relevant wp functions as needed, and continue doing the same. At one point, you'll find the exact statement that is causing the issue.

share|improve this answer
    
WP_HOME and SITEURL both seem fine. It also doesn't seem to be an issue with SSL. Out of curiosity I put the url into tools.pingdom.com and found that the /wp-admin/ url just redirects to itself again and again returning a 302 response header. Can you please explain the die(__FILE... method in more detail. Thanks for your help so far –  Joe Spurling Nov 12 '13 at 15:23
    
@JoeSpurling: done. –  Denis Nov 12 '13 at 15:55
    
thanks for the insight - I'm sure that will come in handy one day. This time the solution was to downgrade my PHP version back to 5.3 –  Joe Spurling Nov 12 '13 at 17:26
    
@JoeSpurling: I'm quite certain the WP core team would like to know about the issue. If possible, head to the Core trac and post steps to reproduce it. –  Denis Nov 12 '13 at 17:46
    
I would normally do so but I'm concerned that my issue was more likely a server configuration issue. I haven't heard of anybody else having issues with Wordpress just because of PHP 5.4. –  Joe Spurling Nov 13 '13 at 15:47

Solution in the end was to downgrade PHP version back to 5.3.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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