#43257 closed defect (bug) (invalid)
wp_redirect() throws error "Cannot modify header information"
| Reported by: | thamaraiselvam | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 4.9.4 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | administration, template |
Description
When I try to
wp_redirect( $url );
it does not redirect and throws following error.
PHP Warning: Cannot modify header information - headers already sent by (output started at /home/accuhomeinspecti/public_html/wp-admin/includes/template.php:2041) in /home/accuhomeinspecti/public_html/wp-includes/pluggable.php on line 1216
This admin class printing throws error : wp-admin/includes/template.php
<?php <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php
Browser:
Version 62.0.3202.94 (Official Build) (64-bit)
PHP
7.1 + Nginx
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This is definitely not a bug in core. See https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php for possible explanations, solutions.