Answers.Body: <p>Solved: this turned out to be a WHM/CPanel bug that was loading imagick module twice.
  Known fixes were found here: <a href="https://forums.cpanel.net/threads/php-warning-module-already-loaded-in-unknown-on-line-0.612735/" rel="nofollow noreferrer">https://forums.cpanel.net/threads/php-warning-module-already-loaded-in-unknown-on-line-0.612735/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-03T21:17:02.390Z
Answers.Text: I'm just gonna drop this here. You'll thank me at some point: https://nystudio107.com/blog/web-hosting-for-agencies-freelancers
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-04T12:55:46.283Z
Answers.Text: hah. read that ages ago but wedded to current infrastructure at the moment
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-03T10:18:50.000Z
Answers.LastActivityDate: 2018-07-03T10:18:50.000Z
Answers.UserDisplayName: joomkit
Body: <p>So i am developing a site on Mamp Pro locally.
  All good.
  Its version controlled with github.
  When deployed to staging server it was fine initially.
  Last Friday deployed again and now i keep getting fatal errors: </p>
  
  <pre><code>    Stack trace:
  #0 /home/mywebpath/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response-&gt;sendHeaders()
  #1 /home/mywebpath/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response-&gt;send()
  #2 /home/mywebpath/vendor/craftcms/cms/src/web/ErrorHandler.php(156): yii\web\ErrorHandler-&gt;renderException(Object(yii\base\ErrorException))
  #3 /home/mywebpath/vendor/yiisoft/yii2/base/ErrorHandler.php(262): craft\web\ErrorHandler-&gt;renderException(Object(yii\base\ErrorException))
  #4 [internal function]: yii\base\ErrorHandler-&gt;handleFatalError()
  #5 {main}
    thrown in /home/mywebpath/vendor/yiisoft/yii2/web/Response.php on line 366
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /home/mywebpath/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /home/mywebpath/vendor/craftcms/cms/src/i18n/Locale.php on line 822
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Uncaught yii\web\HeadersAlreadySentException: Headers already sent. in /home/mywebpath/vendor/yiisoft/yii2/web/Response.php:366
  </code></pre>
  
  <p>I am going to do a vanilla setup on the server just to test but if anyone has any ideas or similar experience do share any resolutions/ideas.
  thx</p>
  
Tags: <debugging>
Title: Random Fatal errors header already sent
ThreadText: # Random Fatal errors header already sent
  
  (Asked by: username_0 on 2018-07-03)
  
  So i am developing a site on Mamp Pro locally.
  All good.
  Its version controlled with github.
  When deployed to staging server it was fine initially.
  Last Friday deployed again and now i keep getting fatal errors:
  
  ```
      Stack trace:
  #0 /home/mywebpath/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
  #1 /home/mywebpath/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()
  #2 /home/mywebpath/vendor/craftcms/cms/src/web/ErrorHandler.php(156): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))
  #3 /home/mywebpath/vendor/yiisoft/yii2/base/ErrorHandler.php(262): craft\web\ErrorHandler->renderException(Object(yii\base\ErrorException))
  #4 [internal function]: yii\base\ErrorHandler->handleFatalError()
  #5 {main}
    thrown in /home/mywebpath/vendor/yiisoft/yii2/web/Response.php on line 366
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /home/mywebpath/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /home/mywebpath/vendor/craftcms/cms/src/i18n/Locale.php on line 822
  [02-Jul-2018 20:59:04 UTC] PHP Fatal error:  Uncaught yii\web\HeadersAlreadySentException: Headers already sent. in /home/mywebpath/vendor/yiisoft/yii2/web/Response.php:366
  
  ```
  
  I am going to do a vanilla setup on the server just to test but if anyone has any ideas or similar experience do share any resolutions/ideas.
  thx
  
  **Tags:** debugging
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-07-03. Score: 1
  
  Solved: this turned out to be a WHM/CPanel bug that was loading imagick module twice.
  Known fixes were found here: <https://forums.cpanel.net/threads/php-warning-module-already-loaded-in-unknown-on-line-0.612735/>
  
  > **Comments:**
  > **username_1**: I'm just gonna drop this here. You'll thank me at some point: https://nystudio107.com/blog/web-hosting-for-agencies-freelancers  
  > **username_0**: hah. read that ages ago but wedded to current infrastructure at the moment  
  
  ---
  
  