WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Cannot modify header information - headers already sent by... (27 posts)

  1. survivalisparamount
    Member
    Posted 6 years ago #

    Hello.
    I have installed WordPress, and made a page called blog.php. All I have in my coding for that document is the php includes for my header and footer of my site, and the "Short and Sweet" code for WordPress. However, when I go to my page blog.php, the following error message shows up:

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/header.php:5) in /home/xxxx/public_html/wp/wp-includes/pluggable.php on line 390

    Here is the coding on line 390 of pluggable.php:
    header("Location: $location");

    For a live example of this on my site goto:

    http://www.survivalisparamount.com/blog.php

    Any help would be appreciated. Thanks.

  2. ceo
    Member
    Posted 6 years ago #

    Please, use the search function.

    This is probably a good jumping off point.

  3. survivalisparamount
    Member
    Posted 6 years ago #

    I did use the search and tried that earlier. There is no unnecessary whitespace on header.php, wp-config.php or pluggable.php. The error say line 5 of my header.php, but the only thing there is:

    <style type="text/css">

    No whitespace or anything.

  4. davestewart
    Member
    Posted 6 years ago #

    Make sure you check both the start and end of the file for whitespace! This has got me before...

  5. survivalisparamount
    Member
    Posted 6 years ago #

    I double checked all three files at the start and end for whitespace and there is none. This is really bugging me...

  6. whooami
    Member
    Posted 6 years ago #

    header("Location: $location"); is sending a header.

    whats on Line 5 of home/xxxx/public_html/header.php ??

    if you are sending content to the browser at line 5, you cant send headers later on.

  7. survivalisparamount
    Member
    Posted 6 years ago #

    On line 5 of my header.php in my root directory like stated in the error message, I just have:

    <style type="text/css">

  8. whooami
    Member
    Posted 6 years ago #

    thats the problem.. youre sending text, and then headers.

    what does blog.php look like exactly? paste it here

    http://wordpress.pastebin.com

    and then link to it

  9. survivalisparamount
    Member
    Posted 6 years ago #

    On blog.php here is my exact coding:

    http://wordpress.pastebin.com/ff2e4609

    or

    <?include("header.php");?>
    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp/wp-blog-header.php');
    ?>
    <?include("footer.php");?>
  10. whooami
    Member
    Posted 6 years ago #

    and thats all wrong. hang on one sec, I need to post to another thread.. ill come right back.

    That file needs to look like this:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp/wp-blog-header.php');
    ?>
    <?include("header.php");?>
    <?include("footer.php");?>

  11. survivalisparamount
    Member
    Posted 6 years ago #

    Ok... let me try that...

  12. survivalisparamount
    Member
    Posted 6 years ago #

    The blog shows up, but not where I want it. I want in between my header and footer so it goes along with the rest of the site. Thanks for helping me get rid of the error though...

    Here's the blog:
    http://www.survivalisparamount.com/blog.php

    and I wan't it to look like this (cutenews):
    http://www.survivalisparamount.com/index.php

  13. whooami
    Member
    Posted 6 years ago #

    thats another issue.

    http://validator.w3.org/check?uri=http://www.survivalisparamount.com/blog.php/

    For instance there are 2 html tags.

    Without seeing the content of all those files its impossible for anyone to tell you what you need to change.

    If you look at the validator results, and look at the order that you are calling things, you ought to be able to figure it out.

    The long and short of it is that you are doing this the hard way.

  14. survivalisparamount
    Member
    Posted 6 years ago #

    The long and short of it is that you are doing this the hard way.

    I'm new to all this WordPress stuff; but how am I doing it the long way?

  15. jouvert
    Member
    Posted 6 years ago #

    I saw this problem and wanted to send my problem too>

    It is long and involved but hopefully you will have the patience:

    Begging for help:

    '''I am a newbie:

    This is the error we saw:
    '''

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/o/u/jou/html/biggydaddy/wp-config.php:25) in /home/content/j/o/u/jou/html/biggydaddy/wp-login.php on line 12

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/o/u/jou/html/bigydaddy/wp-config.php:25) in /home/content/j/o/u/jou/html/biggydaddy/wp-includes/pluggable.php on line 367

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/o/u/jou/html/biggydaddy/wp-config.php:25) in /home/content/j/o/u/jou/html/biggydaddy/wp-includes/pluggable.php on line 368

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/o/u/jou/html/biggydaddy/wp-config.php:25) in

    '''
    This is the wp-config file:'''

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'biggydaddy'); // The name of the database
    define('DB_USER', 'biggydaddy'); // Your MySQL username
    define('DB_PASSWORD', '[mod sighs...]'); // ...and password
    define('DB_HOST', 'p41mysql33.secureserver.net'); // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    -------------------------------------------------
    Also: When I try to bring up the site. The Blog comes up instead

    I want the site to be up not the blog

  16. xjessie007
    Member
    Posted 6 years ago #

    I had a problem with the "headers already sent" too at my http://www.Maxi-Pedia.com website. In my case, it was caused by a blank line at the beginning of one *.inc file. PHP seems to have problems with extra spaces here and there.

    Check all your *.inc files to make sure you do not have closing ?> in any of them. Closing ?> is not needed in your *.inc files. Check all your *.php files to make sure you do not have blank lines at the beginning or at the end.

    If you are working in a CMS, then it may be caused by some module, disable your modules one by one to find out which one causes this.
    This can also be caused by UTF-8. If you have your website coded in ASCII and are saving your php files as UTF-8, it can cause this message. If your website and DB are UTF-8, you should be ok with saving php files as UTF-8 though.

    Btw, this error message is related to output_buffering on/off in your php.ini. If you have output_buffering set to some cache, the server will allow to send headers with delay (or to modify them shortly after they are sent), and this error will not be tripped. But if you set output_buffering to 0 or not at all, then headers can be sent at only one moment, and if you have some bad code, it will trip this error message.

  17. Joni
    Member
    Posted 6 years ago #

    MOD edit the above post by jouvert or jouvert, remove the database information. And then, jouvert, CHANGE IT NOW.

    You just gave the forums the internet equivalent to the keys to your front door.

  18. whooami
    Member
    Posted 6 years ago #

    and such a secure password too :P ... wouldn't want to use anything based on a dictionary word eh.

  19. iridiax
    Member
    Posted 6 years ago #

    Oh my jouvert (or any other newbie), NEVER publicly share the contents of your wp-config file!

  20. xjessie007
    Member
    Posted 6 years ago #

    Ouch, poor man, I hope he changes his pwd to something else after posting it here....

    --------------
    [sig moderated]

  21. jouvert
    Member
    Posted 6 years ago #

    live and learn man

    Yes.. I am a newbie

    chucks

    You guys are honest right?

  22. dallholio
    Member
    Posted 5 years ago #

    I gave up with headers a while back when using someone elses code. Here is my dirty solution to the problem of which I'm not proud.

    It tries to relocate, then if it fails, it attempts it by javascript. if the user doesn't have javascript active (is there anyone in the world that doesn't?), it gives a clickthrough.

    if (!headers_sent($filename, $linenum))
    		{
        		header("Location:?page_id=160&sort=1");
    
        		exit;
    		}
    		else
    		{
    		echo 'Affiliate deleted.<br /><br />  If you are not redirected, click <a href="?page_id=160&sort=1">here</a> manually return to <a href="?page_id=160&sort=1">Affiliate Directory</a>';
    		echo '<script> self.location="?page_id=160&sort=1"; </script>';
    		exit;
    		}
  23. peanut450
    Member
    Posted 5 years ago #

    Thanks to all for the above tips. My code has been working fine, but I had to move to a new server and it has not worked since. I do not have white space before/after php. Any other ideas for this volunteer-newbie? The site: http://www.haywoodmountaineers.com/Register/register.htm

    Here's the message received upon 'submit' of the form: Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/a/y/haywoodmyfl/html/Register/dynaform.php:1) in /home/content/h/a/y/haywoodmyfl/html/Register/dynaform.php on line 386

    Here's the code:

    <?
    
    // ##########################################################################
    // ##########################################################################
    //
    //  DynaForm v1.4 - Created by the Webligo Group
    //                  http://www.webligo.com
    //
    //  YOUR USE OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES YOUR ACCEPTANCE
    //  OF THE FOLLOWING LICENSE AGREEMENT:
    //
    //  THIS SCRIPT AND ALL OF ITS CONTENTS ARE LICENSED UNDER THE
    //  GPL FREEWARE LICENSE. IT MAY NOT BE RESOLD OUR USED COMMERCIALLY
    //  WITHOUT EXPRESSED PERMISSION OF THE WEBLIGO GROUP. IT MAY, HOWEVER,
    //  BE DISTRIBUTED FREELY WITHOUT CHARGE. THIS SOFTWARE IS INTELLECTUAL
    //  PROPERTY OF THE WEBLIGO GROUP. ANYONE VIOLATING THIS AGREEMENT WITHOUT
    //  THE EXPRESSED PERMISSION OF THE WEBLIGO GROUP MAY BE LEGALLY PROSECUTED.
    //  YOUR DOWNLOAD AND USE OF THIS SOFTWARE ALSO SIGNIFIES THAT YOU UNDERSTAND
    //  AND AGREE TO THE DOWNLOAD AGREEMENT YOU READ UPON DOWNLOAD.
    //
    //  The Webligo Group, its management, or any of its employees, associates, or
    //  partners cannot be held liable for any damages that this software may cause.
    //  As the Licensee and user of the software, you agree to accept full liability
    //  for any damages or risk involved with using this software.
    //
    //  If you need help installing or using this software, please
    //  read the readme.txt file that was provided with it.
    //
    //  This file and all related content are the intellectual
    //  property of the Webligo Group and are under copyright.
    //
    //  If you plan to use this script for your clients, sell it as a service,
    //  or utilize it in any other commercial manner, you must purchase a commercial
    //  license. Please see this page for more information:
    //  http://webligo.com/products_dynaform.php
    //
    //  We do not provide support for this script, unless you have purchased a
    //  commercial license.
    //
    //  Feel free to visit our website (http://www.webligo.com)
    //  if you wish to send us any comments, etc.
    //
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### CONFIGURE FROM: ADDRESS ##############################################
    
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
    
    // If you would like to specify the From: address of emails sent by DynaForm,
    // enter it between the double quotes below. If you leave this blank, the
    // server will assign the default email address.
    
    $from_address = "Reynolds450@bellsouth.net";
    
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### ACTIVATE REQUIRED FIELDS? ############################################
    
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
    //
    // If you would like to make some fields of your form required, change "no" to
    // "yes" below.
    
    $required_on = "yes";
    
    // If you have set $required_on to "yes" above, you can make fields required
    // by beginning their name with "r_". For example, if you want to require
    // a user to enter their name, use the following HTML:
    //
    // <input type='text' name='r_Name'>
    //
    // If a user fails to enter a required field, they will be taken to a page
    // where a message such as "You have not completed all the required fields."
    // will be displayed. Please specify the URL to this file below:
    
    $required_errorpage = "error.html";
    
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### OVERRIDE REQUIRED VARIABLES? #########################################
    
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION. NOTE: THIS WILL NOT
    // AFFECT YOUR 'TURN ON REQUIRED FIELDS?' SECTION SETTINGS ABOVE.
    //
    // If you would like to override the three required variables in
    // order to hide your email address, email subject, and thank you page
    // URL from your email form, change "no" to "yes" below.
    
    $override = "no";
    
    // If override is set to "yes", the hidden variables on your HTML
    // email form named "rec_mailto", "rec_subject", and "rec_thanks" will be
    // overridden and can therefore be removed from the form.
    
    // If you have set override to "yes" above, you must specify new values for
    // each of these variables below.
    
    // Enter the email address(es) to send the email to.
    $incoming_mailto = "youremail@yoursite.com";
    
    // Enter the email subject.
    $incoming_subject = "You have a new message from your DynaForm.";
    
    // Enter the thank you page URL.
    $incoming_thanks = "thanks.html";
    
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### BAN IP ADDRESSES? ####################################################
    
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
    //
    // If you would like to ban certain IP addresses from submitting your form,
    // change "no" to "yes" below.
    
    $ban_ip_on = "no";
    
    // If you have set $ban_ip_on to "yes" above, please enter a list of the
    // IP addresses you would like to ban, seperated only by commas.
    // An example has been provided below:
    
    $ban_ip_list = "111.222.33.55,11.33.777.99";
    
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### ACTIVATE DOMAIN SECURITY? ############################################
    //
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
    //
    // This setting, when set to "yes" (default), will check to make sure other
    // people are not submitting data to your dynaform.php file from their
    // external domains. This means that if your domain name is "www.mysite.com",
    // only forms on "www.mysite.com" will be able to use this dynaform.php.
    // IF YOU ARE RECEIVING ERRORS SUCH AS "INVALID DOMAIN" FOR NO REASON, PLEASE
    // CHANGE "yes" TO "no" BELOW.
    
    $secure_domain_on = "no";
    
    // ###########################################################################
    // ###########################################################################
    
    // ###########################################################################
    // #### ACTIVATE AUTO-RESPONSE? ##############################################
    //
    // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU ARE
    // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
    //
    // This setting, when set to "yes", will make DynaForm automatically reply to
    // the user who submitted your form with an email message. If you would like
    // to use this feature, change "no" to "yes" below.
    
    $autorespond_on = "yes";
    
    // If you have set $autorespond_on to "yes" above, you must specify a subject,
    // from-address, and message to include in the auto-response email.
    
    // The following setting is the subject of the auto-response email:
    $autorespond_subject = "Confirmation of Haywood Mountaineers Football Online Registration";
    
    // The following setting is the from-address of the auto-respond email:
    $autorespond_from = "reynolds450@bellsouth.net";
    
    // The following setting is the message of your auto-response email:
    $autorespond_contents = "Your online registration from our website has been received. Thank you!";
    
    // DynaForm also needs to know how to retrieve the user's email address.
    // You must specify the name of the field into which the user will enter
    // their email address. For example, if your email form contains an input
    // field like "<input type='text' name='Email'>" you would set the
    // following setting to "Email".
    $autorespond_mailto_field = "Email";
    
    // ###########################################################################
    // ###########################################################################
    
    // MAKE SURE DYNAFORM IS NOT BEING LOADED FROM THE URL
    if($_SERVER['REQUEST_METHOD'] == "GET") {
    echo "
    <html>
    <head><title>Webligo PHP DynaForm is installed correctly.</title></head>
    <body>
    <font style='font-family: verdana, arial; font-size: 9pt;'>
    <b>DynaForm is installed correctly.</b></font><br />
    <font style='font-family: verdana, arial; font-size: 8pt;'>
    DynaForm Easy PHP Form Mailer was created by <a href='http://www.webligo.com'>Webligo Developments</a>.
    </font>
    </body></html>
    ";
    exit();
    }
    
    // SET VARIABLES
    $incoming_fields = array_keys($_POST);
    $incoming_values = array_values($_POST);
    
    if($override == "no") {
    $incoming_mailto = $_POST['rec_mailto'];
    $incoming_subject = $_POST['rec_subject'];
    $incoming_thanks = $_POST['rec_thanks'];
    }
    
    $incoming_mailto_cc = $_POST['opt_mailto_cc'];
    $incoming_mailto_bcc = $_POST['opt_mailto_bcc'];
    $form_url = $_POST[HTTP_REFERER];
    
    // MAKE SURE DYNAFORM IS BEING RUN FROM THE RIGHT DOMAIN
    if($secure_domain_on == "yes") {
    $form_url_array = parse_url($form_url);
    $form_domain = $form_url_array[host];
    if($form_domain != $_SERVER[HTTP_HOST]) {
    echo "<h2>DynaForm Error - Invalid Domain</h2>
    You have accessed DynaForm from an external domain - this is not allowed.<br />
    You may only submit forms to a DynaForm file that exists on the same domain name.<br />
    If you believe to be receiving this message in error, please refer to your readme.txt file.
    <br /><br />";
    $error = "yes";
    }
    }
    
    // CHECK IF MAILTO IS SET
    if($incoming_mailto == "") {
    echo "<h2>DynaForm Error - Missing Field</h2>
    Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
    the required \"<b>rec_mailto</b>\" field within the form. This field specifies who the email will
    be sent to.
    <br /><br />
    This should look like:<br />
    <input type=\"hidden\" name=\"rec_mailto\" value=\"youremail@yoursite.com\">
    <br /><br />
    If you are still confused, please refer to the readme.txt for more information and examples.<br /><br /><br /><br />
    ";
    $error = "yes";
    }
    
    // CHECK IF SUBJECT IS SET
    if($incoming_subject == "") {
    echo "<h2>DynaForm Error - Missing Field</h2>
    Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
    the required \"<b>rec_subject</b>\" field within the form. This field specifies the subject of
    the email that will be sent.
    <br /><br />
    This should look like:<br />
    <input type=\"hidden\" name=\"rec_subject\" value=\"Registration Email\">
    <br /><br />
    If you are still confused, please refer to the readme.txt for more information and examples.<br /><br /><br /><br />
    ";
    $error = "yes";
    }
    
    // CHECK IF THANKS IS SET
    if($incoming_thanks == "") {
    echo "<h2>DynaForm Error - Missing Field</h2>
    Your form located at <a href='$form_url'>$form_url</a> does not work because you forgot to include
    the required \"<b>rec_thanks</b>\" field within the form. This field specifies what page the user
    will be taken to after they submit the form.
    <br /><br />
    This should look like:<br />
    <input type=\"hidden\" name=\"rec_thanks\" value=\"thanks.html\">
    <br /><br />
    If you are still confused, please refer to the readme.txt for more information and examples.<br /><br /><br /><br />
    ";
    $error = "yes";
    }
    
    // CHECK IF IP ADDRESS IS BANNED
    if($ban_ip_on == "yes") {
    
    if(strstr($ban_ip_list, $_SERVER[REMOTE_ADDR])) {
    echo "<h2>DynaForm Error - Banned IP</h2>
    You cannot use this form because your IP address has been banned by the administrator.<br />
    ";
    $error = "yes";
    }
    }
    
    if($error == "yes") {
    exit();
    }
    
    // SET EMAIL INTRODUCTION
    $message = "This email was received from your DynaForm located at $form_url \n\n";
    
    // LOAD EMAIL CONTENTS
    for ($i = 0; $i < count($incoming_fields); $i++) {
    if($incoming_fields[$i] != "rec_mailto") {
    if($incoming_fields[$i] != "rec_subject") {
    if($incoming_fields[$i] != "rec_thanks") {
    if($incoming_fields[$i] != "opt_mailto_cc") {
    if($incoming_fields[$i] != "opt_mailto_bcc") {
    
    // CHECK FOR REQUIRED FIELDS IF ACTIVATED
    if($required_on == "no") {
    $sub = substr($incoming_fields[$i], 0, 2);
    if($sub == "r_") {
    if($incoming_values[$i] == "" OR !isset($incoming_values[$i]) OR $incoming_values[$i] == " ") {
    header("Location: $required_errorpage");
    exit();
    }}}
    
    // ADD FIELD TO OUTGOING MESSAGE
    $message .= "$incoming_fields[$i]:\n$incoming_values[$i]\n\n";
    }}}}}}
    
    // SET EMAIL FOOTER
    $message .= "\n\nThank you for using our Webligo DynaForm script.\nWe ask that you please link back to our site if you have not already.\nYour use of DynaForm is subject to the license agreement outlined in dynaform.php.\nVisit us at: http://www.webligo.com";
    
    // CLEAR HEADERS
    $headers = "";
    
    // ADD FROM ADDRESS
    if($from_address != "") {
    $headers .= "From: $from_address\r\n";
    }
    
    // CHECK FOR CC OR BCC
    if($incoming_mailto_cc != "") {
    $headers .= "Cc: $incoming_mailto_cc\r\n";
    }
    if($incoming_mailto_bcc != "") {
    $headers .= "Bcc: $incoming_mailto_bcc\r\n";
    }
    
    // SEND EMAIL
    mail($incoming_mailto, $incoming_subject, $message, $headers);
    
    // SEND AUTO-RESPONSE IF ACTIVATED
    if($autorespond_on == "yes") {
    $autorespond_mailto = $_POST[$autorespond_mailto_field];
    $autorespond_headers = "From: $autorespond_from";
    mail($autorespond_mailto, $autorespond_subject, $autorespond_contents, $autorespond_headers);
    }
    
    // FORWARD TO THANK YOU PAGE
    header("Location: $incoming_thanks");
    
    ?>
  24. chocobo2k
    Member
    Posted 5 years ago #

    This is for those who have the same problem I had a few minutes ago. I wasted the whole day searching in the web to fix this problem. I am doing a website too that has a header and footer. and I want to have wordpress in the center [mainContent div]
    RSS refused to work no matter what and i receive that stupid header 5 error message. I kept moving
    <?php include('header.php'); ?>
    <?php include('footer.php'); ?>

    around using whooami suggestion but it didn't work for me even when putting it like

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp/wp-blog-header.php');
    ?>
    <?include("header.php");?>
    <?include("footer.php");?>

    I gave up on it but whooami already gave me the light that I needed.
    What you need to do is to go to your theme directory and open header.php
    and put the link <?php include("header.php");?>
    I am assuming you have put word press in your root folder. if it is under blog folder for example
    <?include("blog/header.php");?>

    do the same thing for the footer. Open footer.php in your theme folder then put the link <?php include("footer.php");?>

    it should work.

    Another issue for those who have design similar to mine. That permalink wont work too because you will have relative links messed up and you will be forced to switch to absolute links which I don't like to do.

    in your header.php put the following line above Title tag

    <html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <base href="http://yourwebsite">
    <title>CILE</title>

    change yourwebsite to your website and save the file. It should work :)

    I hope this helps someone

  25. jimiclapton
    Member
    Posted 5 years ago #

    Hello all!
    I am a newcomer to blogging and was advised to use WP, however I am now experiencing the "Cannot modify header information - headers already sent by..." error message when trying to enter my WP account after entering http://xxx.com/wp-login.php into the address bar.
    The message appears a good 6 times with the errors occurring on lines 255 and 267 of the wp-login.php file, and lines 658, 659, 660 and 850 of the pluggable.php file, from what little I understand.

    Having read the above posts I will of course try and remove any surplus spaces/characters etc from the beginning and end of the files, but could someone please tell me how I go about actually locating the lines when using something like a simple text editor to modify the files. Are the line numbers of any real consequence?

    Responses would be much appreciated.

    Thanks

  26. Sean@WMS
    Member
    Posted 5 years ago #

    If you are installing an "out to the box" version since 2.6.0, you will get this issue if you haven't supplied settings for the following in wp_config.php:

    define('AUTH_KEY', 'put your unique phrase here');
    define('SECURE_AUTH_KEY', 'put your unique phrase here');
    define('LOGGED_IN_KEY', 'put your unique phrase here');
    define('NONCE_KEY', 'put your unique phrase here');

    As that's new stuff since the last fresh WP site I installed, I stubbed my toes on this too.

    The issue is probably with the spaces in the defaults set here. Populate these with nice long alphanumeric strinds with no spaces, and you should be good to go.

  27. adbasque
    Member
    Posted 5 years ago #

    Hi,
    PHP is very tricky so you really have to make sure that there aren't any white spaces, at the bottom and the top of your file.

    at the bottom even if you don't see them with a naked eye doesn't mean there are not there, so I would suggest to place the curser at the end of the last caracter of your script, press the delete button and keep it pressed for a good 10 to 20 seconds to make sure that no white spaces are left.

    And at the top make sure that the very first line is not a white space either.

    That should fix your problem

    I can see a space just after the "<?" in your script.

Topic Closed

This topic has been closed to new replies.

About this Topic