Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error - Warning: Cannot modify header information - headers already sent by

Tags:

wordpress

Error:

Warning: Cannot modify header information - headers already sent by (output started at /home/ya3mblog/public_html/wp-login.php:59) in /home/ya3mblog/public_html/wp-includes/pluggable.php on line 866

website: ipublisharticles.com Error is at: ipublisharticles.com/wp-login.php?action=register

It's preventing user registration using the proper method.

like image 277
user1192684 Avatar asked Feb 06 '12 16:02

user1192684


2 Answers

Add this code in wp-config.php on the first line:

ob_start();
error_reporting(0);
like image 143
Arvind Pal Avatar answered Oct 01 '22 20:10

Arvind Pal


See How_do_I_solve_the_Headers_already_sent_warning_problem? > FAQ Troubleshooting « WordPress Codex

(This error) is usually because there are spaces, new lines, or other stuff before an opening <?php tag or after a closing ?> tag, typically in wp-config.php.

Open the file with a plain text editor (like Notepad or BBEdit) and clear out the white space. Check that the very first characters are <?php and the very last characters are either NOT a PHP closing tag, or a closing tag ?> with no blank lines or spaces after it. (FYI, a PHP file can run fine without the closing ?> tag.)

When saving, be sure the file encoding is not UTF-8 BOM but plain UTF-8 or any without the BOM suffix.

And:

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. Replacing the faulty file with one from your most recent backup or one from a fresh WordPress download is your best bet.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569, then the problem is at line #8 of admin-header.php, not line #569 of post.php. In this scenario, line #569 of post.php is the victim. It is being affected by the excess whitespace at line #8 of admin-header.php.

like image 41
markratledge Avatar answered Oct 01 '22 21:10

markratledge