Cannot modify header information – wp-config.php:1
-
Let me summarise in full as I have no experience in programming, maybe someone here can help me out. Would appreciate it very much.
*Warning: Cannot modify header information – headers already sent by (output started at /home/xxxxxx/public_html/wordpress/wp-config.php:1) in /home/xxxxxx/public_html/wordpress/wp-includes/pluggable.php on line 881*
pluggable.php 881:
function wp_redirect($location, $status = 302) { global $is_IIS; $location = apply_filters('wp_redirect', $location, $status); $status = apply_filters('wp_redirect_status', $status, $location); if ( !$location ) // allows the wp_redirect filter to cancel a redirect return false; $location = wp_sanitize_redirect($location); if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location", true, $status); } endif;
Now wp-config usually refers to hidden whitespace at the begining of the file or at the end but I have checked this and even inserted new wp-config file so the problem can not be there. It has something to do with the latest wordpress version and the plugin I installed. I am using the latest version wordpress 3.4.2. My site seems to be working just fine but the error prevents me getting in to the login page which means I can’t admin at all or uninstall the plugin which seems to have triggered this problem. I have checked the wp.config file hunderds of times with notepad and HTML-kit tools and there is no visible whitespace at the begining nor at the end of the file. I have:
1.Checked the whitespaces from wp-config file with HTML-Kit tools
2.Downloaded and inserted new fresh wp-config file
3 Deleted and then reinstalled the dbc-backup-2 directory via ftp
4.Disabled the plugins directory by renaming it…and the error still remains
The only thing left for me to try is this code someone posted on wordpress forums years ago claiming he had solved this problem by inserting the following code to the wp-config.php file:
<? //dont use header function in wordpress-wp_signup.php global $domain; global $path; //change urlnew variable as per requirment $urlnew = "https://".$domain.$path."/wp-admin/admin.php; echo "<script>"; echo "location = '$urlnew';"; echo "</script>"; echo $urlnew; ?>
However, I am reluctant to add code as I am not familiar with html or php, do not exactly understand how this code functions, do not have detailed instructions where to place it exactly and most of all inserting new code on top of a broken one doesn’t seem to be good idea or something required to solve the root of the problem.
I have read more than 50 posts on this topic and the problem seems to be with contradicting code in wordpress, printing output (text) to the browser, but then for some reason redirecting the user (with wp_redirect) away from that page before the whole page is rendered.
Any suggestions as I have spent now more than 8 hours straight on this issue and am loosing my patience slowly but surely.
- The topic ‘Cannot modify header information – wp-config.php:1’ is closed to new replies.