Answer the question
In order to leave comments, you need to log in
How to fix PHP error "Cannot modify header information - headers already sent by"?
Hello! How to fix PHP error "Cannot modify header information - headers already sent by"? All the answers on the Internet on this topic are powerless in my case. Since they boil down to the fact that it is necessary to remove some extra characters in the files, but I checked and did not find any extra characters anywhere. In addition, the error occurs after loading the site header, in the process of displaying the page content. Site on WordPress. Refers to the theme's header.php file on error. On the second line, which only says this: <?php global woocommerce; ?>. Woocommerce is not installed on the site. The theme is multifunctional (called Avada). When the problematic line is deleted, it starts referring to the next line with php code (in the same file), in which nothing is displayed either. The error appears when redirecting after registering to a specific page of the site, in which PHP code is written and executed through the eval() function. With a normal transition to this page, everything works fine. When logging in, redirecting to this page also works, and it also works when registering on a copy of the site, a redirect to this page occurs. Errors occur in the base file pluggable.php (wp-includes) on lines: 920, 921, 922. I would be very grateful for your help! I am writing here in the last place, since I have been fiddling with the problem for almost a week and everything that I managed to find out was described above. Thanks in advance to those who try to help. php (wp-includes) on lines: 920, 921, 922. I would be very grateful for your help! I am writing here in the last place, since I have been fiddling with the problem for almost a week and everything that I managed to find out was described above. Thanks in advance to those who try to help. php (wp-includes) on lines: 920, 921, 922. I would be very grateful for your help! I am writing here in the last place, since I have been fiddling with the problem for almost a week and everything that I managed to find out was described above. Thanks in advance to those who try to help.
Answer the question
In order to leave comments, you need to log in
Hello!
What is most interesting is that I also encountered such a problem and, as experience shows, it can be for various reasons ....
To eliminate it, try the following options:
1) the presence of extra characters (which you have already checked)
2) the presence of a space (at the very beginning )
3) corrupted or missing theme files (sync with Total commander and see what's different or missing).
Usually, this problem is observed if you downloaded a nulled theme or plugin for free, and the hell "hackers" supplied a bunch of obfuscated PHP code in the theme files... Look in header.php or in the file that it can call. Look in functions.php Scan with Wordfence plugin and Theme Check and check the theme for errors and malicious code... Check if header & footer.php is connected correctly. Try updating the theme to the latest version. Try disabling plugins one by one and see if the problem goes away (sometimes the problem can be in plugins). Check your wp-config.php file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question