0

When uploading to live (goDaddy) i get a message at the bottom of the page "Headers already sent" with the Stack info. I do not have Echo in my controller.

IT happens across multiple controllers

I have reduced my View file to two sections and then tried stepping through removing sections of code and have got the error to disappear by removing two list items

This does have the error

<?php
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
use yii\helpers\Html;
/* @var $this yii\web\View */
 $this->title = Yii::t('app', Yii::$app->name); 
$this->registerCssFile("themes/assets/css/main.css");

?>

<div class="site-index">

     <div class="body-content">             

    <div id="page-wrapper">

  <section id="zero" class="jumbotron">
    <div class="inner">
        <img class="img-responsive center-block" src="uploads/logo_Mtex.png" alt="Mtex Plumbing and Heating">
        <p class="text-muted">Your Home for Domestic and Light Commercial plumbing and Heating <br> Mobile: 07876442995</p>

        <p><a class="btn btn-lg btn-primary" href='site/quote'>Request a Quote</a></p>
    </div>
  </section>

<!-- Two -->
                    <section id="one" class="wrapperplain">
                        <div class="inner">
                            <ul class="features">
                                <li>
                                    <span class="icon major solid fa-tint"></span>
                                    <h4>Plumbing</h4>
                                    <p>Taps, Fixtures and fittings.</p>
                                </li>
                                <li>
                                    <span class="icon solid fa-exclamation-triangle"></span>
                                    <h4>Emergency</h4>
                                    <p>Leak or no heating in winter, No Problem. Call now</p>
                                </li>


                                <li>
                                    <span class="icon major solid fa-tint"></span>
                                    <h4>Plumbing</h4>
                                    <p>Taps, Fixtures and fittings.</p>
                                </li>
                                <li>
                                    <span class="icon solid fa-exclamation-triangle"></span>
                                    <h4>Emergency</h4>
                                    <p>Leak or no heating in winter, No Problem. Call now</p>
                                </li>

                            </ul>
                        </div>
                    </section>

            </div>

</div>
</div>

this does not

<?php
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
use yii\helpers\Html;
/* @var $this yii\web\View */
 $this->title = Yii::t('app', Yii::$app->name); 
$this->registerCssFile("themes/assets/css/main.css");

?>

<div class="site-index">

     <div class="body-content">             

    <div id="page-wrapper">

  <section id="zero" class="jumbotron">
    <div class="inner">
        <img class="img-responsive center-block" src="uploads/logo_Mtex.png" alt="Mtex Plumbing and Heating">
        <p class="text-muted">Your Home for Domestic and Light Commercial plumbing and Heating <br> Mobile: 07876442995</p>

        <p><a class="btn btn-lg btn-primary" href='site/quote'>Request a Quote</a></p>
    </div>
  </section>

<!-- Two -->
                    <section id="one" class="wrapperplain">
                        <div class="inner">
                            <ul class="features">


                                <li>
                                    <span class="icon major solid fa-tint"></span>
                                    <h4>Plumbing</h4>
                                    <p>Taps, Fixtures and fittings.</p>
                                </li>
                                <li>
                                    <span class="icon solid fa-exclamation-triangle"></span>
                                    <h4>Emergency</h4>
                                    <p>Leak or no heating in winter, No Problem. Call now</p>
                                </li>

                            </ul>
                        </div>
                    </section>

            </div>

</div>
</div>
abilham
  • 37
  • 7
  • Views should be irrelevant in this case - they're explicitly buffered by the framework. It could be some space before/after opening/closing PHP tag (` – rob006 Jul 04 '19 at 09:12
  • I see, is there a way to output where it may be encountering the error? The views are not massive so wouldn't expect it to hit buffering limit – abilham Jul 04 '19 at 11:24
  • You may check guide from https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php. Apart form regexp search, nothing comes to my mind. – rob006 Jul 04 '19 at 11:29
  • Thank you! I had missed page start. Works perfect now – abilham Jul 04 '19 at 20:27
  • Does this answer your question? [How to fix "Headers already sent" error in PHP](https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php) – rob006 Jun 26 '20 at 12:32

0 Answers0