Random Fatal errors header already sent 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-&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


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
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/