この記事は機械翻訳のミラー記事です。元の記事にジャンプするにはこちらをクリックしてください。

眺める: 12990|答える: 5

[ウェブ] ウェブサーバー上でよく発生するエラーについては、遅いクエリのエラーログを以下に示します

[リンクをコピー]
掲載地 2014/11/30 21: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秒以上このエラーを記録します。server nginxとphp-fpmです





先の:Discuzのファイル機能の理解を素早く教えてくれますし、これからはファイルの修正に助けを求める必要もなくなります
次に:【切符購入必須】12306 バイパス迂回切符取得 v1.5 グリーン版
掲載地 2014/12/01 12:20:49 |
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 行目にエラーがあり、これが助けになるはずです :L
 地主| 掲載地 2014/12/01 13:45:36 |
Delver_Si 2014年12月1日 12:20に投稿
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 行目にエラーがありますが、ただ...

あなたの妹さん、この言葉が間違っているのは分かっていますが、この書類が何のためかはわかりません
掲載地 2014/12/01 21:01:08 |
/test/source/function/function_filesock.php  源代码给我
 地主| 掲載地 2014/12/01 21: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 nemohou $
*/

if(!defined('IN_DISCUZ')) {
        出口(「アクセス拒否」);
}

関数 _dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE', $allowcurl = TRUE, $position = 0, $files = array( )) {
        $return = '';
        $matches = parse_url($url);
        $scheme = $matches['スキーム'];
        $host = $matches['ホスト'];
        $path = $matches[「パス」] ? $matches[「パス」]。 ($matches['query'] ? '?'. $matches['query'] : '') : '/';
        $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 $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['fileockheader'] = 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 $k => $file) {
                                if(!isset($post[$k]) & file_exists($file)) {
                                        if($fp = @fopen($file, 'r')) {
                                                $v = fread($fp, filesize($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 .= 「Accept-Language: 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 .= 'Content-Length: '.strlen($data).」 \r\n";
                $header .= 「ユーザーエージェント: $_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 .= 「Accept-Language: zh-cn\r\n」;
                $header .= 「ユーザーエージェント: $_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;
        もし(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
                $context = array(
                        'http' => array(
                                「メソッド」=> $post? 『POST』:『GET』、
                                'header' => $header,
                                「内容」=> $post、
                                「タイムアウト」=> $timeout、
                        ),
                );
                $context = stream_context_create($context);
                $fp = @fopen($scheme.'://'.( $ip? $ip : $host).':'.$port.$path, 'b', false, $context);
                $fpflag = 1;
        }

        if(!$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['fileockheader'] = $headers;

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

                        もし($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/02 0:08:32 |
理解できません
免責事項:
Code Farmer Networkが発行するすべてのソフトウェア、プログラミング資料、記事は学習および研究目的のみを目的としています。 上記の内容は商業的または違法な目的で使用されてはならず、そうでなければ利用者はすべての結果を負うことになります。 このサイトの情報はインターネットからのものであり、著作権紛争はこのサイトとは関係ありません。 ダウンロード後24時間以内に上記の内容を完全にパソコンから削除してください。 もしこのプログラムを気に入ったら、正規のソフトウェアを支持し、登録を購入し、より良い本物のサービスを受けてください。 もし侵害があれば、メールでご連絡ください。

Mail To:help@itsvse.com