Help! ERROR: Cookies are blocked due to unexpected output on attempting to login to resolve an issue with my site

wordpress.stackexchange https://wordpress.stackexchange.com/questions/382683

  •  22-04-2021
  •  | 
  •  

Domanda

First-timer over here!

Domain for the buggered website (you'll see what I mean!) http://www.clarkephotographic.co.uk/

URL I am using to try to login to WordPress backend to fix the issue http://www.clarkephotographic.co.uk/wp-login.php

So, when I enter my username, password and then proceed to login, I get the following error message "ERROR: Cookies are blocked due to unexpected output"

enter image description here

The problem I have is that in order to resolve the issue in the first place I would need to login, but as you can see I'm in a bit of a loophole.

Can anyone offer, in as simple terms as possible, any advice on how to get around this, as currently, anyone visiting the site would most likely move onto something that doesn't look like a piece of $hit. I'm planning on closing the site down as covid has dried up that little avenue of pleasure. Onto another project that is more pandemic proof!

Many many thanks in advance

È stato utile?

Soluzione

The "unexpected output" forces PHP to send HTTP headers right before the output is sent, and that's too early for WordPress, which can't send cookies later as they are HTTP headers too.

If you look at your site, you get a bunch of notices at the top, which means you have something like …

define( 'WP_DEBUG', true );

… in your wp-config.php. You should never set that to true on a live site.

So how to fix it? Two steps:

  1. Access your site per FTP or SSH, and edit the wp-config.php, so WP_DEBUG is set to false.

  2. Then log in, and update WordPress. Newer versions won't have this problem.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top