Cannot modify header information - headers already sent by












0















I'm using Magento 2.2.7 CE with Porto theme and seem to be randomly finding the following error in the var/report folder:



{"0":"Warning: Cannot modify header information - headers already sent by (output started at /home/passionh/public_html/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php:114) in /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 148","1":"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/home/passionh/...', 148, Array)n#1 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(148): setcookie('store', 'gb', 1577536511, '/', '', false, true)n#2 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(121): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setCookie('store', 'gb', Array)n#3 /home/passionh/public_html/vendor/magento/module-store/Model/StoreCookieManager.php(61): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('store', 'gb', Object(Magento\Framework\Stdlib\Cookie\PublicCookieMetadata))n#4 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Store\Model\StoreCookieManager->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#5 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Store\Model\StoreCookieManager\Interceptor->___callParent('setStoreCookie', Array)n#6 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Store\Model\StoreCookieManager\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Store\Model\Store\Interceptor))n#7 /home/passionh/public_html/generated/code/Magento/Store/Model/StoreCookieManager/Interceptor.php(26): Magento\Store\Model\StoreCookieManager\Interceptor->___callPlugins('setStoreCookie', Array, Array)n#8 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(462): Magento\Store\Model\StoreCookieManager\Interceptor->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#9 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(431): Bss\GeoIPAutoSwitchStore\Observer\Redirect->makeRedirects(Object(Magento\Store\Model\Store\Interceptor), Object(Magento\Framework\Event\Observer), 'store')n#10 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(203): Bss\GeoIPAutoSwitchStore\Observer\Redirect->redirectFunction('GB', Object(Magento\Framework\Event\Observer))n#11 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(168): Bss\GeoIPAutoSwitchStore\Observer\Redirect->handleRedirects(NULL, 0, 0, 0, '0', '213.205.242.104', '0', Object(Magento\Framework\Event\Observer))n#12 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Bss\GeoIPAutoSwitchStore\Observer\Redirect->execute(Object(Magento\Framework\Event\Observer))n#13 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Bss\GeoIPAutoSwitchStore\Observer\Redirect), Object(Magento\Framework\Event\Observer))n#14 /home/passionh/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))n#15 /home/passionh/public_html/vendor/magento/framework/App/Http.php(147): Magento\Framework\Event\Manager->dispatch('controller_fron...', Array)n#16 /home/passionh/public_html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()n#17 /home/passionh/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))n#18 {main}","url":"/","script_name":"/index.php"}


I don't know where to look to sort this issue, if anyone could point me in the right direction that would be great!










share|improve this question





























    0















    I'm using Magento 2.2.7 CE with Porto theme and seem to be randomly finding the following error in the var/report folder:



    {"0":"Warning: Cannot modify header information - headers already sent by (output started at /home/passionh/public_html/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php:114) in /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 148","1":"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/home/passionh/...', 148, Array)n#1 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(148): setcookie('store', 'gb', 1577536511, '/', '', false, true)n#2 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(121): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setCookie('store', 'gb', Array)n#3 /home/passionh/public_html/vendor/magento/module-store/Model/StoreCookieManager.php(61): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('store', 'gb', Object(Magento\Framework\Stdlib\Cookie\PublicCookieMetadata))n#4 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Store\Model\StoreCookieManager->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#5 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Store\Model\StoreCookieManager\Interceptor->___callParent('setStoreCookie', Array)n#6 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Store\Model\StoreCookieManager\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Store\Model\Store\Interceptor))n#7 /home/passionh/public_html/generated/code/Magento/Store/Model/StoreCookieManager/Interceptor.php(26): Magento\Store\Model\StoreCookieManager\Interceptor->___callPlugins('setStoreCookie', Array, Array)n#8 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(462): Magento\Store\Model\StoreCookieManager\Interceptor->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#9 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(431): Bss\GeoIPAutoSwitchStore\Observer\Redirect->makeRedirects(Object(Magento\Store\Model\Store\Interceptor), Object(Magento\Framework\Event\Observer), 'store')n#10 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(203): Bss\GeoIPAutoSwitchStore\Observer\Redirect->redirectFunction('GB', Object(Magento\Framework\Event\Observer))n#11 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(168): Bss\GeoIPAutoSwitchStore\Observer\Redirect->handleRedirects(NULL, 0, 0, 0, '0', '213.205.242.104', '0', Object(Magento\Framework\Event\Observer))n#12 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Bss\GeoIPAutoSwitchStore\Observer\Redirect->execute(Object(Magento\Framework\Event\Observer))n#13 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Bss\GeoIPAutoSwitchStore\Observer\Redirect), Object(Magento\Framework\Event\Observer))n#14 /home/passionh/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))n#15 /home/passionh/public_html/vendor/magento/framework/App/Http.php(147): Magento\Framework\Event\Manager->dispatch('controller_fron...', Array)n#16 /home/passionh/public_html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()n#17 /home/passionh/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))n#18 {main}","url":"/","script_name":"/index.php"}


    I don't know where to look to sort this issue, if anyone could point me in the right direction that would be great!










    share|improve this question



























      0












      0








      0








      I'm using Magento 2.2.7 CE with Porto theme and seem to be randomly finding the following error in the var/report folder:



      {"0":"Warning: Cannot modify header information - headers already sent by (output started at /home/passionh/public_html/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php:114) in /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 148","1":"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/home/passionh/...', 148, Array)n#1 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(148): setcookie('store', 'gb', 1577536511, '/', '', false, true)n#2 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(121): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setCookie('store', 'gb', Array)n#3 /home/passionh/public_html/vendor/magento/module-store/Model/StoreCookieManager.php(61): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('store', 'gb', Object(Magento\Framework\Stdlib\Cookie\PublicCookieMetadata))n#4 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Store\Model\StoreCookieManager->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#5 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Store\Model\StoreCookieManager\Interceptor->___callParent('setStoreCookie', Array)n#6 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Store\Model\StoreCookieManager\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Store\Model\Store\Interceptor))n#7 /home/passionh/public_html/generated/code/Magento/Store/Model/StoreCookieManager/Interceptor.php(26): Magento\Store\Model\StoreCookieManager\Interceptor->___callPlugins('setStoreCookie', Array, Array)n#8 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(462): Magento\Store\Model\StoreCookieManager\Interceptor->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#9 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(431): Bss\GeoIPAutoSwitchStore\Observer\Redirect->makeRedirects(Object(Magento\Store\Model\Store\Interceptor), Object(Magento\Framework\Event\Observer), 'store')n#10 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(203): Bss\GeoIPAutoSwitchStore\Observer\Redirect->redirectFunction('GB', Object(Magento\Framework\Event\Observer))n#11 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(168): Bss\GeoIPAutoSwitchStore\Observer\Redirect->handleRedirects(NULL, 0, 0, 0, '0', '213.205.242.104', '0', Object(Magento\Framework\Event\Observer))n#12 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Bss\GeoIPAutoSwitchStore\Observer\Redirect->execute(Object(Magento\Framework\Event\Observer))n#13 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Bss\GeoIPAutoSwitchStore\Observer\Redirect), Object(Magento\Framework\Event\Observer))n#14 /home/passionh/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))n#15 /home/passionh/public_html/vendor/magento/framework/App/Http.php(147): Magento\Framework\Event\Manager->dispatch('controller_fron...', Array)n#16 /home/passionh/public_html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()n#17 /home/passionh/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))n#18 {main}","url":"/","script_name":"/index.php"}


      I don't know where to look to sort this issue, if anyone could point me in the right direction that would be great!










      share|improve this question
















      I'm using Magento 2.2.7 CE with Porto theme and seem to be randomly finding the following error in the var/report folder:



      {"0":"Warning: Cannot modify header information - headers already sent by (output started at /home/passionh/public_html/vendor/zendframework/zend-http/src/PhpEnvironment/Response.php:114) in /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 148","1":"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/home/passionh/...', 148, Array)n#1 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(148): setcookie('store', 'gb', 1577536511, '/', '', false, true)n#2 /home/passionh/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(121): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setCookie('store', 'gb', Array)n#3 /home/passionh/public_html/vendor/magento/module-store/Model/StoreCookieManager.php(61): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('store', 'gb', Object(Magento\Framework\Stdlib\Cookie\PublicCookieMetadata))n#4 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Store\Model\StoreCookieManager->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#5 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Store\Model\StoreCookieManager\Interceptor->___callParent('setStoreCookie', Array)n#6 /home/passionh/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Store\Model\StoreCookieManager\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Store\Model\Store\Interceptor))n#7 /home/passionh/public_html/generated/code/Magento/Store/Model/StoreCookieManager/Interceptor.php(26): Magento\Store\Model\StoreCookieManager\Interceptor->___callPlugins('setStoreCookie', Array, Array)n#8 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(462): Magento\Store\Model\StoreCookieManager\Interceptor->setStoreCookie(Object(Magento\Store\Model\Store\Interceptor))n#9 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(431): Bss\GeoIPAutoSwitchStore\Observer\Redirect->makeRedirects(Object(Magento\Store\Model\Store\Interceptor), Object(Magento\Framework\Event\Observer), 'store')n#10 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(203): Bss\GeoIPAutoSwitchStore\Observer\Redirect->redirectFunction('GB', Object(Magento\Framework\Event\Observer))n#11 /home/passionh/public_html/app/code/Bss/GeoIPAutoSwitchStore/Observer/Redirect.php(168): Bss\GeoIPAutoSwitchStore\Observer\Redirect->handleRedirects(NULL, 0, 0, 0, '0', '213.205.242.104', '0', Object(Magento\Framework\Event\Observer))n#12 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Bss\GeoIPAutoSwitchStore\Observer\Redirect->execute(Object(Magento\Framework\Event\Observer))n#13 /home/passionh/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Bss\GeoIPAutoSwitchStore\Observer\Redirect), Object(Magento\Framework\Event\Observer))n#14 /home/passionh/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))n#15 /home/passionh/public_html/vendor/magento/framework/App/Http.php(147): Magento\Framework\Event\Manager->dispatch('controller_fron...', Array)n#16 /home/passionh/public_html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()n#17 /home/passionh/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))n#18 {main}","url":"/","script_name":"/index.php"}


      I don't know where to look to sort this issue, if anyone could point me in the right direction that would be great!







      magento2 header magento2.2.7






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 15 mins ago









      Shoaib Munir

      658318




      658318










      asked Dec 28 '18 at 16:21









      Jordan BergermanJordan Bergerman

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0














          my experience with this is: that can be hard to troubleshoot.



          the reason for this bug in my experience may be:




          • setting a cookie before the magento dispatch event is triggered is quite difficult to find but would give this error; that would be after installing a new module that has observer and set the cookie indeed on a wrong event

          • that can be after inserting into a php file a character before the php opening tag <?php. git status might show you these weird php openings..

          • in fact, I have not had it with Magento but the closing php ?> tag can give the same problem I believe. It is Magento recommended practice not to close the php script file (see some comments)


          As you can see, these pointers are quite broad and I can feel if you would want to give up on either of these ideas..



          Now, in practical terms, just disable all your custom modules, or latest modules added first and flush the cache, clear cookies, cache storage.. and then once the error has gone, re-enable some modules.






          share|improve this answer


























          • Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

            – Jordan Bergerman
            Dec 30 '18 at 23:38











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256090%2fcannot-modify-header-information-headers-already-sent-by%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          my experience with this is: that can be hard to troubleshoot.



          the reason for this bug in my experience may be:




          • setting a cookie before the magento dispatch event is triggered is quite difficult to find but would give this error; that would be after installing a new module that has observer and set the cookie indeed on a wrong event

          • that can be after inserting into a php file a character before the php opening tag <?php. git status might show you these weird php openings..

          • in fact, I have not had it with Magento but the closing php ?> tag can give the same problem I believe. It is Magento recommended practice not to close the php script file (see some comments)


          As you can see, these pointers are quite broad and I can feel if you would want to give up on either of these ideas..



          Now, in practical terms, just disable all your custom modules, or latest modules added first and flush the cache, clear cookies, cache storage.. and then once the error has gone, re-enable some modules.






          share|improve this answer


























          • Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

            – Jordan Bergerman
            Dec 30 '18 at 23:38
















          0














          my experience with this is: that can be hard to troubleshoot.



          the reason for this bug in my experience may be:




          • setting a cookie before the magento dispatch event is triggered is quite difficult to find but would give this error; that would be after installing a new module that has observer and set the cookie indeed on a wrong event

          • that can be after inserting into a php file a character before the php opening tag <?php. git status might show you these weird php openings..

          • in fact, I have not had it with Magento but the closing php ?> tag can give the same problem I believe. It is Magento recommended practice not to close the php script file (see some comments)


          As you can see, these pointers are quite broad and I can feel if you would want to give up on either of these ideas..



          Now, in practical terms, just disable all your custom modules, or latest modules added first and flush the cache, clear cookies, cache storage.. and then once the error has gone, re-enable some modules.






          share|improve this answer


























          • Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

            – Jordan Bergerman
            Dec 30 '18 at 23:38














          0












          0








          0







          my experience with this is: that can be hard to troubleshoot.



          the reason for this bug in my experience may be:




          • setting a cookie before the magento dispatch event is triggered is quite difficult to find but would give this error; that would be after installing a new module that has observer and set the cookie indeed on a wrong event

          • that can be after inserting into a php file a character before the php opening tag <?php. git status might show you these weird php openings..

          • in fact, I have not had it with Magento but the closing php ?> tag can give the same problem I believe. It is Magento recommended practice not to close the php script file (see some comments)


          As you can see, these pointers are quite broad and I can feel if you would want to give up on either of these ideas..



          Now, in practical terms, just disable all your custom modules, or latest modules added first and flush the cache, clear cookies, cache storage.. and then once the error has gone, re-enable some modules.






          share|improve this answer















          my experience with this is: that can be hard to troubleshoot.



          the reason for this bug in my experience may be:




          • setting a cookie before the magento dispatch event is triggered is quite difficult to find but would give this error; that would be after installing a new module that has observer and set the cookie indeed on a wrong event

          • that can be after inserting into a php file a character before the php opening tag <?php. git status might show you these weird php openings..

          • in fact, I have not had it with Magento but the closing php ?> tag can give the same problem I believe. It is Magento recommended practice not to close the php script file (see some comments)


          As you can see, these pointers are quite broad and I can feel if you would want to give up on either of these ideas..



          Now, in practical terms, just disable all your custom modules, or latest modules added first and flush the cache, clear cookies, cache storage.. and then once the error has gone, re-enable some modules.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 28 '18 at 16:57

























          answered Dec 28 '18 at 16:50









          Herve TribouilloyHerve Tribouilloy

          1,289510




          1,289510













          • Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

            – Jordan Bergerman
            Dec 30 '18 at 23:38



















          • Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

            – Jordan Bergerman
            Dec 30 '18 at 23:38

















          Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

          – Jordan Bergerman
          Dec 30 '18 at 23:38





          Thank you Herve, I honestly don't have a clue with where to start, I did read elsewhere it is something to do with the php opening and closing tags, as well as the format the file is saved as. All of that would make a little more sense to me if I had edited some php files, however I haven't...it has left me clueless.

          – Jordan Bergerman
          Dec 30 '18 at 23:38


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256090%2fcannot-modify-header-information-headers-already-sent-by%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Polycentropodidae

          Magento 2 Error message: Invalid state change requested

          Paulmy