Fix Cannot modify header information in WordPress

Recently, some of you using the hosting of GoDaddy , DreamHost , HostGator , Hostvn.net ... contacted me to ask for support about the Paradise theme error Cannot modify header information - headers already sent by [...] when installing and activating. In fact, this is a leading error in WordPress , usually occurs when you install a theme or plugin that is not compatible with PHP of hosting.
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/domain.com/wp-content/themes/paradise/functions.php:1) in /home/username/public_html/domain.com/wp-includes/pluggable.php on line 1179
view rawfunctions.php hosted with ❤ by GitHub
    The reason I say so because the same plugin, 1 theme is the same but this error only appears on hosting of certain suppliers. For example, with a theme Paradise but when installed on the hosting of HawkHost , StableHost , NameCheap , FTECH.VN ... did not happen the above. .

    How to fix Cannot modify header information error?

    There are 3 different options to fix Cannot modify header information - headers already sent by in WordPress :

    Option 1: check the PHP file for errors

    In fact, this is very difficult, especially for people who are not familiar with PHP because the error message usually does not specify the faulty line of code. Therefore, if you are a common WordPress user, you should skip this option.

    Option 2: use ob_start (); and ob_end_flush ();

    Access to the host via File Manager of cPanel / DirectAdmin or FTP software Find and open the corrupted PHP file. Insert the following commands inside and save:
    • Insert command ob_start (); at the beginning of the PHP file. This command will start the server's buffer pool to temporarily store echo (output) content into it.
    • Insert command ob_end_flush (); at the end of the PHP file. This command works to bring data from the server's buffer pool back to the content.

    Option 3: edit the php.ini file

    If you have permission to set up hosting php.ini file , add the following code inside it:
    output_buffering = ON
    view rawphp.ini hosted with ❤ by GitHub
    If you do not have permission to edit this file, please contact your service provider for assistance.
    Above are 3 options to fix Cannot modify header information [...] . Hope it helps you solve the problem quickly.
    Any questions and suggestions regarding Cannot modify header information [...] please send in the comment box below for support and answers.
    If you like this post, please subscribe to my blog to regularly update the latest and greatest posts via email. Thanks very much. :)
    Related Posts
    Nguyen Diep
    My name is Nguyen Manh Cuong. I was born in a poor village in Ba Vi district, HA NOI province - windy and sunny land. Currently

    Related Posts

    Post a Comment