ymdq3

ymdq3

这家伙有点懒,还没写个性签名!

  • 财富值40
  • 威望值0
  • 总积分120

个人信息

  • 赞了回答

    yii\web\Response 方法中

    protected function sendHeaders()
    {
        if (headers_sent($file, $line)) {
            return; //此处返回
            throw new HeadersAlreadySentException($file, $line);
        }
        if ($this->_headers) {
            foreach ($this->getHeaders() as $name => $values) {
                $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));
                // set replace for first occurrence of header but false afterwards to allow multiple
                $replace = true;
                foreach ($values as $value) {
                    header("$name: $value", $replace);
                    $replace = false;
                }
            }
        }
        $statusCode = $this->getStatusCode();
        header("HTTP/{$this->version} {$statusCode} {$this->statusText}");
        $this->sendCookies();
    }
    
  • 回复了 的回答

    yii\web\Response 方法中

    protected function sendHeaders()
    {
        if (headers_sent($file, $line)) {
            return; //此处返回
            throw new HeadersAlreadySentException($file, $line);
        }
        if ($this->_headers) {
            foreach ($this->getHeaders() as $name => $values) {
                $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));
                // set replace for first occurrence of header but false afterwards to allow multiple
                $replace = true;
                foreach ($values as $value) {
                    header("$name: $value", $replace);
                    $replace = false;
                }
            }
        }
        $statusCode = $this->getStatusCode();
        header("HTTP/{$this->version} {$statusCode} {$this->statusText}");
        $this->sendCookies();
    }
    

    尝试了 exit;return;
    前者没有报错,后者会报 syntax error, unexpected ')'

  • 2018-10-31 已签到
    连续签到1天,获得了5个金钱
  • 提出了问题
    Yii2 HeadersAlreadySentException 报错
  • 2018-10-20 已签到
    连续签到1天,获得了5个金钱
  • 回复了 的回答

    应该是线上没有安装eaccelerator,不过话说回来,php7的话,还是opcache吧,官方出品效果保证,eaccelerator应该慢慢退出历史舞台了。

    感谢建议,php5.6,已经换成了opcache

  • 回复了 的回答

    再次打开底端的debug模块试试,是不是还出现上述的错误,如果是的话,那就说明debug模块会用到上述的动态库来加速优化。
    一般线上不开debug,如果非要开的话,那就装一下动态库再说吧,咋样?

    debug模块已经关闭了,查实是因为php.ini加载了该文件,奇怪的是xampp一键安装后并没有该文件,请问大佬们用什么部署线上环境,学习

  • 提出了问题
    网站部署上线,初次加载报错
  • 2018-10-17 已签到
    连续签到1天,获得了5个金钱
  • 2018-09-05 已签到
    连续签到1天,获得了5个金钱
助理 等级规则
120/200
资料完整度
10/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

0

Ta的访客

2