How to fix the PHP error "Cannot modify header information — headers already sent by"?

0 like 0 dislike
Hello! How to fix the PHP error "Cannot modify header information - headers already sent by"? All the answers on the Internet on this subject, in my case, powerless. As reduced to the fact that you need to delete some extra characters in the file, but I checked, and extra characters not found anywhere else. In addition, the error occurs after loading the caps site, in the output process of the page's content. Website on WordPress. If the error references a file header.php in the subject line. On the second line that says only this: <?php global woocommerce; ?>. Woocommerce on the website is not installed. The theme is multifunctional (called Avada). Deleting the problematic line begins to refer to the following line of php code (in the same file), which is also nothing displayed. Error appears when was redirected after registration to a specific page of the website, which reads PHP code and executed using the eval () function. In the ordinary go to this page, everything works fine. If the login was redirected to this page also works, and also when registration on a copy of your site there is a redirect to this page. Faults occurring in the underlying file pluggable.php (wp-includes)lines: 920, 921, 922. I would be very grateful for the help! I write here in the last turn as the problem of Potter for almost a week and all found out described above. Thanks in advance to those who are trying to help.
by | 19 views

2 Answers

0 like 0 dislike
What is most interesting - this problem I have also met and how the experience can be it for different reasons....
To resolve it try the following options:
1) extra characters (which you already checked)
2) of a gap (in the beginning)
3) damaged or missing theme files (sync with Total commander and see what is different or what is missing).
Usually, this problem occurs if you downloaded a nulled theme or plugin free of charge, and Woe to the "hackers" had a bunch of obfuscated PHP code in theme files... let's See header.php or a file that it can cause. View in functions.php Scan plugin Wordfence and Theme Check and theme check for errors and malicious code... Verify the connection header footer.php. Try to update the theme to the latest version. Repeat this process to disable plugins and see if the problem is gone (sometimes the problem can be owned in plugins). Check the file wp-config.php
0 like 0 dislike
The problem is solved! Was it in the plugin WP Super Cache. At the time of finalization of the site I have disabled caching in the plugin. In consequence of which I got this error. If you disable the plugin, the error does not disappear. It turned out that the most flagrant manner. I made a copy of the site before I began to deal with the modifications in the copy all worked. Then, when hope was lost, last jerk was just to take roughly to replace all files in wp-content files backup. Among these files outside the plugin directory and the file was called wp-cache-config.php. There are generated the plugin settings of WP Super Cache. And after replacing all the files in the wp-content folder, it worked. Well, then by process of elimination I found out that the above configuration file, contained just disabled configuration caching. I safely disconnected in the middle of development, that she would not interfere. After you enable this settings, all working again but with my files and folders. I hope my experience will be useful to someone, as this took almost a month) and even engaged in at work, at home till 4 am on the weekends for cognac) in General, may God grant you all patience)
PS: I got the idea to write a small plugin for logging actions with the website, not to forget the little things, but I'm sure something is there)

Related questions

0 like 0 dislike
2 answers
asked Apr 13, 2019 by webJunior
0 like 0 dislike
1 answer
asked Apr 9, 2019 by danilochagov
110,608 questions
257,186 answers
28,664 users