이 글은 기계 번역의 미러 문서이며, 원본 기사로 바로 이동하려면 여기를 클릭해 주세요.

보기: 12990|회답: 5

[웹] 웹 서버에서 자주 발생하는 오류들, 아래는 느린 쿼리에 대한 오류 로그입니다

[링크 복사]
게시됨 2014. 11. 30. 오후 9:09:51 | | |
[2014년 11월 30일 20:22:25]  [풀 www] PID 10383
script_filename = /test/forum.php
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68
[0x00007fe08a61e960] _dfsockopen() /test/source/function/function_core.php:201
[0x00007fe08a61e7c0] dfsockopen() /test/source/class/class_image.php:123
[0x00007fe08a61e608] init() /test/source/class/class_image.php:45
[0x00007fe08a61e2a8] 엄지손가락() /test/source/function/function_block.php:410
[0x00007fe08a61e038] block_template() /test/source/function/function_block.php:177
[0x00007fe08a61def8] block_fetch_content() /test/source/function/function_block.php:120
[0x00007fe08a61de18] block_display_batch() /test/source/function/function_core.php:804
[0x00007fe08a61dbd0] block_display() /test/data/template/3_diy_forum_discuz.tpl.php:29
[0x00007fe08a61d828] +++ 덤프 실패

[2014년 11월 30일 20:22:26]  [풀 www] PID 10392
script_filename = /test/forum.php
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68
[0x00007fe08a61e960] _dfsockopen() /test/source/function/function_core.php:201
[0x00007fe08a61e7c0] dfsockopen() /test/source/class/class_image.php:123
[0x00007fe08a61e608] init() /test/source/class/class_image.php:45
[0x00007fe08a61e2a8] 엄지손가락() /test/source/function/function_block.php:410
[0x00007fe08a61e038] block_template() /test/source/function/function_block.php:177
[0x00007fe08a61def8] block_fetch_content() /test/source/function/function_block.php:120
[0x00007fe08a61de18] block_display_batch() /test/source/function/function_core.php:804
[0x00007fe08a61dbd0] block_display() /test/data/template/3_diy_forum_discuz.tpl.php:29
[0x00007fe08a61d828] +++ 덤프 실패


이 오류의 원인을 알고 있고, 느린 쿼리 실행이 이 오류를 5초 이상 기록합니다. 서버 nginx와 php-fpm





이전의:Discuz의 파일 기능을 빠르게 이해할 수 있게 가르쳐 주고, 이제부터는 파일을 수정하는 데 도움을 요청할 필요가 없습니다
다음:[기차표 구매 필수 아이템] 12306 우회 우회 티켓 획득 v1.5 녹색 버전
게시됨 2014. 12. 1. 오후 12:20:49 |
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 라인에 오류가 있는데, 이게 도움이 될 거예요 :L
 집주인| 게시됨 2014. 12. 1. 오후 1:45:36 |
Delver_Si 2014-12-1 12:20에 게시됨
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 행에 오류가 발생하는데, 단지 ...

네 여동생, 이 문장이 틀렸다는 것도 알지만, 이 문서가 뭘 위한 건지 모르겠어
게시됨 2014. 12. 1. 오후 9:01:08 |
/test/source/function/function_filesock.php  源代码给我
 집주인| 게시됨 2014. 12. 1. 오후 9:14:41 |
Delver_Si 2014-12-1 21:01에 게시됨
/test/source/function/function_filesock.php  源代码给我

[mw_shl_code=php,true]<?php

/**
* [디스쿠즈!] (C)2001-2099 Comsenz Inc.
* 이 콘텐츠는 프리웨어가 아니며, 사용은 라이선스 조건에 따라 적용됩니다
*
* $Id: function_filesock.php 34441 2014-04-29 07:47:26Z 네모호우 $
*/

if(!defined('IN_DISCUZ')) {
        출구('접근 거부됨');
}

함수 _dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = 참, $encodetype = 'URLENCODE', $allowcurl = 참, $position = 0, $files = 배열( )) {
        $return = '';
        $matches = parse_url($url);
        $scheme = $matches['스킴'];
        $host = $matches['호스트'];
        $path = $matches['경로'] ? $matches['경로']. ($matches['문의'] ? '?'. $matches['문의'] : '') : '/';
        $port = !empty($matches['port']) ? $matches['port'] : ($scheme == 'http'? '80' : '');
        $boundary = $encodetype == 'URLENCODE' ? '' : 무작위(40);

        if($post) {
                if(!is_array($post)) {
                        parse_str($post, $post);
                }
                _format_postkey($post, $postnew);
                $post = $postnew;
        }
        if(function_exists('curl_init') & & function_exists('curl_exec') & $allowcurl) {
                $ch = curl_init();
                $httpheader = array();
                if($ip) {
                        $httpheader[] = "호스트: ".$host;
                }
                if($httpheader) {
                        curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
                }
                curl_setopt($ch, CURLOPT_URL, $scheme.'://'.( $ip? $ip : $host). ($port? ':'.$port : '').$path);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 거짓);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 거짓);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 참);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 참);
                curl_setopt($ch, CURLOPT_HEADER, 1);
                if($post) {
                        curl_setopt($ch, CURLOPT_POST, 1);
                        if($encodetype == 'URLencode') {
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
                        } 그렇지 않으면 {
                                foreach($post as $k => $v) {
                                        if(isset($files[$k])) {
                                                $post[$k] = '@'.$files[$k];
                                        }
                                }
                                foreach($files as $k => $file) {
                                        if(!isset($post[$k]) & file_exists($file)) {
                                                $post[$k] = '@'.$file;
                                        }
                                }
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
                        }
                }
                if($cookie) {
                        curl_setopt($ch, CURLOPT_COOKIE, $cookie);
                }
                curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
                curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
                $data = curl_exec($ch);
                $status = curl_getinfo($ch);
                $errno = curl_errno($ch);
                curl_close($ch);
                if($errno || $status['http_code'] != 200) {
                        복귀;
                } 그렇지 않으면 {
                        $GLOBALS['파일삭헤더'] = substr($data, 0, $status['header_size']);
                        $data = substr($data, $status['header_size']);
                        돌아와!$limit? $data : substr($data, 0, $limit);
                }
        }

        if($post) {
                if($encodetype == 'URLencode') {
                        $data = http_build_query($post);
                } 그렇지 않으면 {
                        $data = '';
                        foreach($post as $k => $v) {
                                $data .= "--$boundary\r\n";
                                $data .= '내용-배치: 형태-데이터; name="'.$k.'''. (isset($files[$k]) ? '; filename="'.basename($files[$k]).'"; Content-Type: application/octet-stream' : '')." "\r\n\r\n";
                                $data .= $v." \r\n";
                        }
                        foreach($files as $k => $file) {
                                if(!isset($post[$k]) & file_exists($file)) {
                                        if($fp = @fopen($file, 'r')) {
                                                $v = fread($fp, 파일 크기($file));
                                                fclose($fp);
                                                $data .= "--$boundary\r\n";
                                                $data .= '내용-배치: 형태-데이터; name="'.$k.'"; filename="'.basename($file).'"; 콘텐츠-타입: application/octet-stream'." "\r\n\r\n";
                                                $data .= $v." \r\n";
                                        }
                                }
                        }
                        $data .= "--$boundary\r\n";
                }
                $out = "POST $path HTTP/1.0\r\n";
                $header = "수락: */*\r\n";
                $header .= "수락-언어: zh-cn\r\n";
                $header .= $encodetype == 'URLencode' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data; 경계=$boundary\r\n";
                $header .= '내용 길이: '.strlen($data)." \r\n";
                $header .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
                $header .= "진행자: $host:$port\r\n";
                $header .= "연결: Close\r\n";
                $header .= "캐시-제어: no-cache\r\n";
                $header .= "쿠키: $cookie\r\n\r\n";
                $out .= $header;
                $out .= $data;
        } 그렇지 않으면 {
                $out = "GET $path HTTP/1.0\r\n";
                $header = "수락: */*\r\n";
                $header .= "수락-언어: zh-cn\r\n";
                $header .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
                $header .= "진행자: $host:$port\r\n";
                $header .= "연결: Close\r\n";
                $header .= "쿠키: $cookie\r\n\r\n";
                $out .= $header;
        }

        $fpflag = 0;
        if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
                $context = 배열(
                        'http' => array(
                                '방법' => $post ? 'POST' : 'GET',
                                '헤더' => $header,
                                '내용' => $post,
                                '타임아웃' => $timeout,
                        ),
                );
                $context = stream_context_create($context);
                $fp = @fopen($scheme.'://'.( $ip? $ip : $host).':'.$port.$path, 'b', 거짓, $context);
                $fpflag = 1;
        }

        만약(!$fp) {
                반환 '';
        } 그렇지 않으면 {
                stream_set_blocking($fp, $block);
                stream_set_timeout($fp, $timeout);
                @fwrite($fp, $out);
                $status = stream_get_meta_data($fp);
                if(!$status['timed_out']) {
                        반면 (!feof($fp) & & !$fpflag) {
                                $header = @fgets($fp);
                                $headers .= $header;
                                if($header && ($header == "\r\n" ||  $header == "\n")) {
                                        브레이크;
                                }
                        }
                        $GLOBALS['파일삭헤더'] = $headers;

                        if($position) {
                                for($i=0; $i<$position; $i++) {
                                        $char = fgetc($fp);
                                        if($char == "\n" & $oldchar != "\r") {
                                                $i++;
                                        }
                                        $oldchar = $char;
                                }
                        }

                        if($limit) {
                                $return = stream_get_contents($fp, $limit);
                        } 그렇지 않으면 {
                                $return = stream_get_contents($fp);
                        }
                }
                @fclose($fp);
                $return 반환;
        }
}

함수 _format_postkey($post, &$result, $key = '') {
        foreach($post as $k => $v) {
                $_k = $key? $key.' ['.$k.']' : $k;
                if(is_array($v)) {
                        _format_postkey($v, $result, $_k);
                } 그렇지 않으면 {
                        $result[$_k] = $v;
                }
        }
}

?>[/mw_shl_code]
게시됨 2014. 12. 2. 오전 12:08:32 |
이해할 수 없어요
면책 조항:
Code Farmer Network에서 발행하는 모든 소프트웨어, 프로그래밍 자료 또는 기사는 학습 및 연구 목적으로만 사용됩니다; 위 내용은 상업적 또는 불법적인 목적으로 사용되지 않으며, 그렇지 않으면 모든 책임이 사용자에게 부담됩니다. 이 사이트의 정보는 인터넷에서 가져온 것이며, 저작권 분쟁은 이 사이트와는 관련이 없습니다. 위 내용은 다운로드 후 24시간 이내에 컴퓨터에서 완전히 삭제해야 합니다. 프로그램이 마음에 드신다면, 진짜 소프트웨어를 지원하고, 등록을 구매하며, 더 나은 진짜 서비스를 받아주세요. 침해가 있을 경우 이메일로 연락해 주시기 바랍니다.

Mail To:help@itsvse.com