An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /usr/share/nginx/html/mysite/web/pdf_generator/index2.php on line 1. in /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/web/Response.php:366
Stack trace:
#0 /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()
#2 /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/base/ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#4 {main}
Previous exception:
yii\web\HeadersAlreadySentException: Headers already sent in /usr/share/nginx/html/mysite/web/pdf_generator/index2.php on line 1. in /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/web/Response.php:366
Stack trace:
#0 /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /usr/share/nginx/html/mysite/vendor/yiisoft/yii2/base/Application.php(392): yii\web\Response->send()
#2 /usr/share/nginx/html/mysite/web/index.php(14): yii\base\Application->run()
#3 {main}
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link href="/pdf_generator/css/styles.pretty2.css" rel="stylesheet" />
</head>
An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /var/www/ru.russiadiscovery/web/pdf_generator/second2.php on line 40. in /var/www/ru.russiadiscovery/vendor/yiisoft/yii2/web/Response.php:366
Stack trace:
#0 /var/www/ru.site/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /var/www/ru.site/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()
#2 /var/www/ru.site/vendor/yiisoft/yii2/base/ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#4 {main}
Previous exception:
yii\web\HeadersAlreadySentException: Headers already sent in /var/www/ru.site/web/pdf_generator/second2.php on line 40. in /var/www/ru.site/vendor/yiisoft/yii2/web/Response.php:366
Stack trace:
#0 /var/www/ru.site/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /var/www/ru.site/vendor/yiisoft/yii2/base/Application.php(392): yii\web\Response->send()
#2 /var/www/ru.site/web/index.php(14): yii\base\Application->run()
#3 {main}
<p><?= $arResult["BLOCK_ORDER"]["TOUR_NAME"] ?></p>
function Get_HTML ($file)
{
if (!file_exists ($file))
return false;
ob_start ();
extract ($GLOBALS, EXTR_OVERWRITE);
include ($file);
$content = ob_get_contents ();
ob_end_clean ();
return $content;
}
$content = Get_HTML ('path/to/your/include');
// ...
echo $content; // вывод на страницу не раньше, чем будут выполнены все php-скрипты