系统发生错误

[2] ErrorException in Cookie.php line 97

Cannot modify header information - headers already sent by (output started at /www/wwwroot/youzhen/app_web/runtime/classmap.php:1)

  1. }
  2. $name = $config['prefix'] . $name;
  3. // 设置cookie
  4. if (is_array($value)) {
  5. array_walk_recursive($value, 'self::jsonFormatProtect', 'encode');
  6. $value = 'think:' . json_encode($value);
  7. }
  8. $expire = !empty($config['expire']) ? $_SERVER['REQUEST_TIME'] + intval($config['expire']) : 0;
  9. if ($config['setcookie']) {
  10. setcookie($name, $value, $expire, $config['path'], $config['domain'], $config['secure'], $config['httponly']);
  11. }
  12. $_COOKIE[$name] = $value;
  13. }
  14. /**
  15. * 永久保存Cookie数据
  16. * @param string $name cookie名称
  17. * @param mixed $value cookie值
  18. * @param mixed $option 可选参数 可能会是 null|integer|string

Call Stack

  1. in Cookie.php line 97
  2. at Error::appError(2, 'Cannot modify header...', '/www/wwwroot/youzhen...', 97, ['name' => 'think_var', 'value' => 'en-us', 'option' => ['expire' => 3600], ...])
  3. at setcookie('think_var', 'en-us', 1733884188, '/', '', false, '') in Cookie.php line 97
  4. at Cookie::set('think_var', 'en-us', ['expire' => 3600]) in Lang.php line 166
  5. at Lang::detect() in App.php line 90
  6. at App::run() in start.php line 18
  7. at require('/www/wwwroot/youzhen...') in index.php line 17

Exception Datas

Error Context
name think_var
value en-us
option { "expire": 3600 }
config { "prefix": "", "expire": 3600, "path": "\/", "domain": "", "secure": false, "httponly": "", "setcookie": true }
expire 1733884188

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookies
Hm_lvt_5430651aa058e0825f678886c2571c16 1731896574,1732417737,1733539333
Hm_lvt_c039452ebcf0055ec7f3a2444039dd1b 1732242871,1732417737,1733020509,1733539335
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_COOKIE Hm_lvt_5430651aa058e0825f678886c2571c16=1731896574,1732417737,1733539333; Hm_lvt_c039452ebcf0055ec7f3a2444039dd1b=1732242871,1732417737,1733020509,1733539335
HTTP_PRIORITY u=0, i
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.9
HTTP_ACCEPT_ENCODING gzip, deflate, br, zstd
HTTP_SEC_FETCH_DEST document
HTTP_SEC_FETCH_USER ?1
HTTP_SEC_FETCH_MODE navigate
HTTP_SEC_FETCH_SITE none
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
HTTP_PURPOSE prefetch
HTTP_SEC_PURPOSE prefetch;prerender
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_SEC_CH_UA_PLATFORM "Windows"
HTTP_SEC_CH_UA_MOBILE ?0
HTTP_SEC_CH_UA "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"
HTTP_HOST uzhen.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.uzhen.com
SERVER_PORT 443
SERVER_ADDR 172.30.156.99
REMOTE_PORT 52954
REMOTE_ADDR 118.69.96.180
SERVER_SOFTWARE nginx/1.24.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/youzhen/app_web/public
DOCUMENT_URI /index.php
REQUEST_URI /
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /www/wwwroot/youzhen/app_web/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1733880588.7221
REQUEST_TIME 1733880588
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/youzhen/app_web/public/../application/
THINK_VERSION 5.0.5
THINK_START_TIME 1733880588.7225
THINK_START_MEM 404104
EXT .php
DS /
THINK_PATH /www/wwwroot/youzhen/app_web/thinkphp/
LIB_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/
CORE_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/think/
TRAIT_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/traits/
ROOT_PATH /www/wwwroot/youzhen/app_web/
EXTEND_PATH /www/wwwroot/youzhen/app_web/extend/
VENDOR_PATH /www/wwwroot/youzhen/app_web/vendor/
RUNTIME_PATH /www/wwwroot/youzhen/app_web/runtime/
LOG_PATH /www/wwwroot/youzhen/app_web/runtime/log/
CACHE_PATH /www/wwwroot/youzhen/app_web/runtime/cache/
TEMP_PATH /www/wwwroot/youzhen/app_web/runtime/temp/
CONF_PATH /www/wwwroot/youzhen/app_web/public/../application/
CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false
系统发生错误

[2] ErrorException in Cookie.php line 97

Cannot modify header information - headers already sent by (output started at /www/wwwroot/youzhen/app_web/runtime/classmap.php:1)

  1. }
  2. $name = $config['prefix'] . $name;
  3. // 设置cookie
  4. if (is_array($value)) {
  5. array_walk_recursive($value, 'self::jsonFormatProtect', 'encode');
  6. $value = 'think:' . json_encode($value);
  7. }
  8. $expire = !empty($config['expire']) ? $_SERVER['REQUEST_TIME'] + intval($config['expire']) : 0;
  9. if ($config['setcookie']) {
  10. setcookie($name, $value, $expire, $config['path'], $config['domain'], $config['secure'], $config['httponly']);
  11. }
  12. $_COOKIE[$name] = $value;
  13. }
  14. /**
  15. * 永久保存Cookie数据
  16. * @param string $name cookie名称
  17. * @param mixed $value cookie值
  18. * @param mixed $option 可选参数 可能会是 null|integer|string

Call Stack

  1. in Cookie.php line 97
  2. at Error::appError(2, 'Cannot modify header...', '/www/wwwroot/youzhen...', 97, ['name' => 'think_var', 'value' => 'en-us', 'option' => ['expire' => 3600], ...])
  3. at setcookie('think_var', 'en-us', 1733984296, '/', '', false, '') in Cookie.php line 97
  4. at Cookie::set('think_var', 'en-us', ['expire' => 3600]) in Lang.php line 166
  5. at Lang::detect() in App.php line 90
  6. at App::run() in start.php line 18
  7. at require('/www/wwwroot/youzhen...') in index.php line 17

Exception Datas

Error Context
name think_var
value en-us
option { "expire": 3600 }
config { "prefix": "", "expire": 3600, "path": "\/", "domain": "", "secure": false, "httponly": "", "setcookie": true }
expire 1733984296

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_CONNECTION Keep-Alive
HTTP_HOST uzhen.com
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Mon, 04 Nov 2024 21:44:20 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.uzhen.com
SERVER_PORT 80
SERVER_ADDR 172.30.156.99
REMOTE_PORT 40066
REMOTE_ADDR 18.97.14.90
SERVER_SOFTWARE nginx/1.24.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/youzhen/app_web/public
DOCUMENT_URI /index.php
REQUEST_URI /
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /www/wwwroot/youzhen/app_web/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1733980696.4736
REQUEST_TIME 1733980696
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/youzhen/app_web/public/../application/
THINK_VERSION 5.0.5
THINK_START_TIME 1733980696.4739
THINK_START_MEM 402864
EXT .php
DS /
THINK_PATH /www/wwwroot/youzhen/app_web/thinkphp/
LIB_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/
CORE_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/think/
TRAIT_PATH /www/wwwroot/youzhen/app_web/thinkphp/library/traits/
ROOT_PATH /www/wwwroot/youzhen/app_web/
EXTEND_PATH /www/wwwroot/youzhen/app_web/extend/
VENDOR_PATH /www/wwwroot/youzhen/app_web/vendor/
RUNTIME_PATH /www/wwwroot/youzhen/app_web/runtime/
LOG_PATH /www/wwwroot/youzhen/app_web/runtime/log/
CACHE_PATH /www/wwwroot/youzhen/app_web/runtime/cache/
TEMP_PATH /www/wwwroot/youzhen/app_web/runtime/temp/
CONF_PATH /www/wwwroot/youzhen/app_web/public/../application/
CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false