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.

After migrating site to another account on same host, I started to receives strange errors. Firstly I encountered an error where at the login page I was asked to turn on Cookies. And after I deleted that part of the file in wp-login.php (I turned off that test cookie wp is setting when user is wp login screen).

Nowm when I visit my site without www, so just domainname.com, and when I visit wp-login.php and try to log in, I get a Headers already sent error, for file pluggable.php on line 897

I tried all standard solutions including:

  • Downgrading Wordpress
  • Reseting plugins folder
  • Checked if my files are started and ended regulary with
  • Checking sites URL in phpMyAdmin, reseting permalink structure

My sites on two accounts have exact same files, dbs and settings I have properly done the migration itself, and changed the links in the database. Both of the sites are on new server, that has exact same configuration :)

Any ideas?

Thanks in advance

share|improve this question
2  
"And after I deleted that part of the file in wp-login.php" Did you actually went and deleted code from a core file? –  Pieter Goosen Mar 29 at 5:15
    
I removed the three lines where WP sets test cookie for the user that came on wp-login.php That shouldnt affect other functionalitites. Any ideas? –  Josip Gvozdić Mar 29 at 12:12
    
Post the error message exactly as it appears. Copy and paste it. –  s_ha_dum Mar 29 at 14:07

2 Answers 2

It is usually because there are spaces, new lines, or other stuff before an opening tag, typically in wp-config.php. This could be true about some other file too, so please check the error message, as it will list the specific file name where the error occurred.

Other Resources:

share|improve this answer
    
File is Pluggable.php, no errors there. –  Josip Gvozdić Mar 29 at 12:11

Headers already sent error, for file pluggable.php on line 897

You need a solution to the problem above, and that is very easy. Reinstall a fresh copy of Wordpress

I was asked to turn on Cookies. And after I deleted that part of the file in wp-login.php (I turned off that test cookie wp is setting when user is wp login screen).

There is no bigger sin in Wordpress programming than to hack, change, delete or add any type of code, no matter how small to core files, themes and plugins. And excuse me for shouting, but NEVER EVER, AND I MEAN EVER, DO THAT!!!!!!

Wordpress are coded and tested by some of the top coders in the world. All new versions goes through very tough testing, and by the time a new version goes live, all bugs are sorted. Wordpress developers also keep Wordpress up-to-date and new versions are regulary released. So, if anything goes wrong with your installation, 99.99999% it is not Wordpress.

That said, even if a problem is related to the core, YOU SHOULD NEVER EVER CHANGE CORE FILES, PERIOD.

The same apply to themes and plugins that aren't yours. Theme files and plugin files should also never ever be changed, and like in never, and only when you are the author. That is what child themes are for.

Why should you never change core, theme or plugin files? The answer is simple, As with Wordpress core, many themes and plugins available, updates are always available, and if you made any changes to these files, your changes will be overwritten, and you will loose them for ever, and there is no turning back.

Always always use a child theme, and always always make changes inside that child theme. As previously said, the only time you can change theme and plugin files is when you are the author.

That said, what should you do if you encounter a problem?

Debug, debug, debug, always debug. That is one aspect that so many miss, and most of the time setting debug to true in wp-config.php will exactly print your problem, so you will immediatly know where to start looking.

if debugging gives up nothing, you should firstly deactivate all plugins, one by one, and check after each one if the problem remain or if it is solved. Most of the time this will solve your problem. If that doesn't work, deactivate your theme and activate one of the default themes that is shipped with wordpress. If that solves your problem, you know it is your theme. If your problem however remain, your problem is usually core related or server related. If you suspect it might be the core that is corrupt, just install a fresh copy. (Always make a backup before you do that). If it is server related, it is always a great idea to speak to your hosting provider first.

I would urge you, reinstall a fresh copy of wordpress and start from the top and follow my instructions, and if that doesn't solve your problem, or if you are unsure what is causing it, edit your question or start a new one with the details of the actual problem " I was asked to turn on Cookies".

I hope this not only helps you, but everyone how finds this page.

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.