Este artigo é um artigo espelhado de tradução automática, por favor clique aqui para ir para o artigo original.

Vista: 12990|Resposta: 5

[Web] Erros que frequentemente ocorrem em servidores web, abaixo está o registro de erros para consultas lentas

[Copiar link]
Publicado em 30/11/2014 21:09:51 | | |
[30-Nov-2014 20:22:25]  [piscina www] PID 10383
script_filename = /teste/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] Thumb() /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] +++ despejo falhou

[30-Nov-2014 20:22:26]  [piscina www] PID 10392
script_filename = /teste/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] Thumb() /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] +++ despejo falhou


Você sabe qual é a causa desse erro, e a execução lenta da consulta vai registrar esse erro por mais de 5 segundos, servidor nginx e php-fpm





Anterior:Ensinar-te a entender rapidamente a função de arquivos do Discuz!, e você não precisará mais pedir ajuda para modificar arquivos a partir de agora
Próximo:[Indispensável para comprar passagens de trem] 12306 Bypass Desvio de bilhetes v1.5 versão verde
Publicado em 01/12/2014 12:20:49 |
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 Há um erro na linha 68, que só pode ajudar :L
 Senhorio| Publicado em 01/12/2014 13:45:36 |
Delver_Si Postado em 2014-12-1 às 12:20
[0x00007fe08a61eba8] curl_exec() /test/source/function/function_filesock.php:68 Há um erro na linha 68, só ...

Sua irmã, eu também sei que essa linha está errada, mas não sei para que serve esse documento
Publicado em 01/12/2014 21:01:08 |
/test/source/function/function_filesock.php  源代码给我
 Senhorio| Publicado em 01/12/2014 21:14:41 |
Delver_Si Postado em 2014-12-1 às 21:01
/test/source/function/function_filesock.php  源代码给我

[mw_shl_code=php,true]<?php

/**
* [Discus!] (C)2001-2099 Comsenz Inc.
* Isto NÃO é um freeware, o uso está sujeito aos termos da licença
*
* $Id: function_filesock.php 34441 2014-04-29 07:47:26Z nemohou $
*/

if(!defined('IN_DISCUZ')) {
        saída('Acesso negado');
}

função _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['esquema'];
        $host = $matches['anfitrião'];
        $path = $matches['caminho'] ? $matches['caminho']. ($matches['consulta']? '?'. $matches['consulta'] : '') : '/';
        $port = !vazia($matches['porta']) ? $matches['porto'] : ($scheme == 'http' ? '80' : '');
        $boundary = $encodetype == 'URLENCODE' ? '' : aleatório(40);

        se($post) {
                if(!is_array($post)) {
                        parse_str($post, $post);
                }
                _format_postkey($post, $postnew);
                $post = $postnew;
        }
        se(function_exists('curl_init') && function_exists('curl_exec') &&$allowcurl) {
                $ch = curl_init();
                $httpheader = array();
                se($ip) {
                        $httpheader[] = "Apresentador: ".$host;
                }
                se($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, falso);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, falso);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, verdadeiro);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, verdadeiro);
                curl_setopt($ch, CURLOPT_HEADER, 1);
                se($post) {
                        curl_setopt($ch, CURLOPT_POST, 1);
                        if($encodetype == 'URLENCODE') {
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
                        } else {
                                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) {
                        retorno;
                } else {
                        $GLOBALS['cabeçalho de arquivo'] = substr($data, 0, $status['header_size']);
                        $data = substr($data, $status['header_size']);
                        retorne!$limit ? $data : substr($data, 0, $limit);
                }
        }

        se($post) {
                if($encodetype == 'URLENCODE') {
                        $data = http_build_query($post);
                } else {
                        $data = '';
                        foreach($post as $k => $v) {
                                $data .= "--$boundary\r\n";
                                $data .= 'Disposição de Conteúdo: formato-dados; name="'$k.'"'. (isset($files[$k])? '; nome do arquivo="'.basename($files[$k]).'"; Tipo de Conteúdo: application/octeto-stream' : '')." \r\n\r\n";
                                $data .= $v." \r\n";
                        }
                        foreach($files as $k => $file) {
                                if(!isset($post[$k]) && file_exists($file)) {
                                        se($fp = @fopen($file, 'r')) {
                                                $v = fread($fp, tamanho do arquivo($file));
                                                fclose($fp);
                                                $data .= "--$boundary\r\n";
                                                $data .= 'Disposição de Conteúdo: formato-dados; nome="'.$k.'"; nome do arquivo="'.basename($file).'"; Tipo de Conteúdo: aplicação/fluxo de octetos'." \r\n\r\n";
                                                $data .= $v." \r\n";
                                        }
                                }
                        }
                        $data .= "--$boundary\r\n";
                }
                $out = "POST $path HTTP/1.0\r\n";
                $header = "Aceitar: */*\r\n";
                $header .= "Aceitar Linguagem: zh-cn\r\n";
                $header .= $encodetype == 'URLENCODE' ? "Tipo-Conteúdo: application/x-www-form-urlencoded\r\n" : "Tipo-Conteúdo: multipart/form-data; fronteira=$boundary\r\n";
                $header .= 'Comprimento do Conteúdo: '.strlen($data)." \r\n";
                $header .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
                $header .= "Apresentador: $host:$port\r\n";
                $header .= "Conexão: Próxima\r\n";
                $header .= "Cache-Control: no-cache\r\n";
                $header .= "Cookie: $cookie\r\n\r\n";
                $out .= $header;
                $out .= $data;
        } else {
                $out = "GET $path HTTP/1.0\r\n";
                $header = "Aceitar: */*\r\n";
                $header .= "Aceitar Linguagem: zh-cn\r\n";
                $header .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
                $header .= "Apresentador: $host:$port\r\n";
                $header .= "Conexão: Próxima\r\n";
                $header .= "Cookie: $cookie\r\n\r\n";
                $out .= $header;
        }

        $fpflag = 0;
        if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) {
                $context = array(
                        'http' => array(
                                'método' => $post ? 'POST' : 'GET',
                                'cabeçalho' => $header,
                                'content' => $post,
                                'timeout' => $timeout,
                        ),
                );
                $context = stream_context_create($context);
                $fp = @fopen($scheme.'://'.( $ip? $ip : $host).':'.$port.$path, 'b', falso, $context);
                $fpflag = 1;
        }

        if(!$fp) {
                retorno '';
        } else {
                stream_set_blocking($fp, $block);
                stream_set_timeout($fp, $timeout);
                @fwrite($fp, $out);
                $status = stream_get_meta_data($fp);
                if(!$status['timed_out']) {
                        enquanto (!feof($fp) && !$fpflag) {
                                $header = @fgets($fp);
                                $headers .= $header;
                                if($header && ($header == "\r\n" ||  $header == "\n")) {
                                        intervalo;
                                }
                        }
                        $GLOBALS['cabeçalho de arquivo'] = $headers;

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

                        se($limit) {
                                $return = stream_get_contents($fp, $limit);
                        } else {
                                $return = stream_get_contents($fp);
                        }
                }
                @fclose($fp);
                retorno $return;
        }
}

função _format_postkey($post, &$result, $key = '') {
        foreach($post as $k => $v) {
                $_k = $key ? $key.' ['.$k.']' : $k;
                if(is_array($v)) {
                        _format_postkey($v, $result, $_k);
                } else {
                        $result[$_k] = $v;
                }
        }
}

?>[/mw_shl_code]
Publicado em 02/12/2014 00:08:32 |
Não posso entender
Disclaimer:
Todo software, material de programação ou artigos publicados pela Code Farmer Network são apenas para fins de aprendizado e pesquisa; O conteúdo acima não deve ser usado para fins comerciais ou ilegais, caso contrário, os usuários terão todas as consequências. As informações deste site vêm da Internet, e disputas de direitos autorais não têm nada a ver com este site. Você deve deletar completamente o conteúdo acima do seu computador em até 24 horas após o download. Se você gosta do programa, por favor, apoie um software genuíno, compre o registro e obtenha serviços genuínos melhores. Se houver qualquer infração, por favor, entre em contato conosco por e-mail.

Mail To:help@itsvse.com