Please find below Stack Trace I pasted from apache error logs.
An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent. in /var/www/html/staging_v2/vendor/yiisoft/yii2/web/Response.php:373
Stack trace:
#0
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/Response.php(346): yii\web\Response->sendHeaders()
#1
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#2
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/ErrorHandler.php(135): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))
#3
[internal function]: yii\base\ErrorHandler->handleException(Object(yii\base\ErrorException))
#4
{main}
Previous exception:
yii\base\ErrorException: strpos(): Empty needle in /var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php:111
Stack trace:
#0
[internal function]: yii\base\ErrorHandler->handleError(2, 'strpos(): Empty...', '/var/www/html/s...', 111, Array)
#1
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php(111): strpos('en-US', '')
#2
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php(78): yii\i18n\PhpMessageSource->loadFallbackMessages('yii', '', NULL, '/var/www/html/s...')
#3 /var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/MessageSource.php(107): yii\i18n\PhpMessageSource->loadMessages('yii', NULL)
#4
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/MessageSource.php(87): yii\i18n\MessageSource->translateMessage('yii', '{attribute} can...', NULL)
#5
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/I18N.php(90): yii\i18n\MessageSource->translate('yii', '{attribute} can...', NULL)
#6
/var/www/html/staging_v2/vendor/yiisoft/yii2/BaseYii.php(538): yii\i18n\I18N->translate('yii', '{attribute} can...', Array, NULL)
#7
/var/www/html/staging_v2/vendor/yiisoft/yii2/validators/RequiredValidator.php(62): yii\BaseYii::t('yii', '{attribute} can...')
#8
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/BaseObject.php(109): yii\validators\RequiredValidator->init()
#9
[internal function]: yii\base\BaseObject->__construct(Array)
#10
/var/www/html/staging_v2/vendor/yiisoft/yii2/di/Container.php(420): ReflectionClass->newInstanceArgs(Array)
#11
/var/www/html/staging_v2/vendor/yiisoft/yii2/di/Container.php(171): yii\di\Container->build('yii\\validators\\...', Array, Array)
#12
/var/www/html/staging_v2/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('yii\\validators\\...', Array, Array)
#13
/var/www/html/staging_v2/vendor/yiisoft/yii2/validators/Validator.php(231): yii\BaseYii::createObject(Array)
#14
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(469): yii\validators\Validator::createValidator('yii\\validators\\...', Object(frontend\models\ContactForm), Array, Array)
#15 /var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(421): yii\base\Model->createValidators()
#16
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(190): yii\base\Model->getValidators()
#17
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(817): yii\base\Model->scenarios()
#18
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(435): yii\base\Model->activeAttributes()
#19
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(495): yii\base\Model->getActiveValidators('name')
#20
/var/www/html/staging_v2/vendor/yiisoft/yii2/widgets/ActiveField.php(929): yii\base\Model->isAttributeRequired('name')
#21
/var/www/html/staging_v2/vendor/yiisoft/yii2/widgets/ActiveField.php(405): yii\widgets\ActiveField->addAriaAttributes(Array)
#22
/var/www/html/staging_v2/frontend/views/site/index.php(143): yii\widgets\ActiveField->textInput(Array)
#23
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/View.php(348): require('/var/www/html/s...')
#24
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile('/var/www/html/s...', Array)
#25
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/View.php(213): yii\base\View->renderFile('/var/www/html/s...', Array, Object(frontend\controllers\SiteController))
#26 /var/www/html/staging_v2/vendor/yiisoft/yii2/web/Controller.php(53): yii\web\View->renderAjax('index', Array, Object(frontend\controllers\SiteController))
#27 /var/www/html/staging_v2/frontend/controllers/SiteController.php(555): yii\web\Controller->renderAjax('index', Array)
#28
[internal function]: frontend\controllers\SiteController->actionIndex()
#29
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#30
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#31
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Module.php(534): yii\base\Controller->runAction('index', Array)
#32
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/Application.php(104): yii\base\Module->runAction('site/index', Array)
#33
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#34
/var/www/html/staging_v2/frontend/web/index.php(0): yii\base\Application->run()
#35
You can find the issue here: https://staging-v2.storna.app
Admin Portal works https://staging-v2.storna.app/admin
API works too
Only landing pages have an issue.. it was working fine earlier.
What could be the issue?
There are only 2 issues in log. and 1 of which is warning and another is just a php7 notice. so I doubt it is due to this.
question from:
https://stackoverflow.com/questions/65835893/yii2-strpos-empty-needle-in-phpmessagesource-php-on-line-111 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…