error set_time_limit () has been disabled for security reasons in [duplicate]

0

When executing my code the following error is returned

  

Warning: set_time_limit () has been disabled for security reasons in /storage/ssd3/854/1950854/public_html/envio1.php on line 78

The problem is in the hosting or the code? If it is in the code where I went wrong?

<html>
<head>
    <style>
        textarea#lista {width:70%; height:40%; resize:none; outline:none;}
        button#limpar {width:30%;}
        input#separador {width:9%; height:5%; border-radius:5px; text-align:center;}
        input#testar {width:30%;}
    </style>
</head>
<body>
<center>    
    <div class="panel panel-primary" style="width:70%;">
        <div class="panel-heading">
            PROXYS TEST
        </div>
    </div>

    <form method="post">

        <textarea name="lista" id="lista" class="form-control" placeholder="proxy|porta"><?php if(isset($_POST['lista'])){echo $_POST['lista'];} ?></textarea><br>

        <button type="button" class="btn btn-info" id="limpar" name="limpar" onclick="window.location='index.php'">Voltar</button>

        <input id="separador" name="separador" value="<?php if(isset($_POST['separador'])){echo $_POST['separador'];} else {echo "|";} ?>">

        <input type="submit" class="btn btn-success" id="testar" name="testar" value="Testar">

    </form>
</center>   
</body>
</html>



<?php

function doRequest($url, $method, $rt){
    global $post, $referer, $proxy, $retorno;
    $ch = curl_init();
    curl_setopt_array($ch, array(
        CURLOPT_URL => $url,
        CURLOPT_FOLLOWLOCATION => 1,
        CURLOPT_RETURNTRANSFER => $rt,
        CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
        #CURLOPT_HTTPHEADER => array('Content-Type: application/json; charset=UTF-8'), //ALTERAR AQUI
        CURLOPT_SSL_VERIFYPEER => 0,
        CURLOPT_SSL_VERIFYHOST => 2,
        CURLOPT_COOKIESESSION => 1,
        CURLOPT_COOKIEJAR => 'cookies.txt', //ALTERAR AQUI
        CURLOPT_COOKIEFILE => 'cookies.txt', //ALTERAR AQUI
        CURLOPT_REFERER => $referer,
    ));
    if($method == 'POST'){
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    if(isset($proxy)){
        curl_setopt($ch, CURLOPT_PROXY, $proxy);
    }
    $retorno = curl_exec($ch);
    curl_close($ch);
}

function value($string, $start, $end){
    $str = explode($start, $string);
    $str = explode($end, $str[1]);
    return $str[0];
}

function rm_cookies($cookies){
    if(file_exists($cookies)){
        unlink($cookies);
    }
}



set_time_limit(0);
error_reporting(0);


if(isset($_POST['lista'])){
    $line = explode("\r\n", $_POST['lista']);

    $separador = $_POST['separador'];
    $proxy = $_POST['proxy'];

    echo '<center>';
    echo '<div class="panel panel-success" style="width:70%;">
            <div class="panel-heading">
                <h3 class="panel-title">Aprovados</h3>
            </div>
            <div class="panel-body">
                <font id="lives"></font>
            </div>
          </div>';

    echo '<div class="panel panel-danger" style="width:70%;">
            <div class="panel-heading">
                <h3 class="panel-title">Reprovados</h3>
            </div>
            <div class="panel-body">
                <font id="dies"></font>
            </div>
          </div>';





    for($i=0;$i<count($line);$i++){
        $acc = explode($separador, $line[$i]);
        $proxy = $acc[0];
        $porta = $acc[1];



        rm_cookies('cookies.txt'); //ALTERAR AQUI

        doRequest('###censurado###', 'GET', 1); //ALTERAR AQUI

        #$token = value($retorno, '<a href="/logout" role="menuitem"><i class="icon-key"></i>Sair</a>'); //ALTERAR AQUI

        $post = '###censurado##'; //ALTERAR AQUI

        doRequest('###censurado###', 'POST', 1); //ALTERAR AQUI








        if (strpos($retorno, 'Sair')){
            echo '<script>$("#lives").prepend("'.$proxy.' | '.$porta.'<br>");</script>'; //ALTERAR AQUI
        }

        else {
            echo '<script>$("#dies").prepend("'.$proxy.' | '.$porta.'<br>");</script>'; //ALTERAE AQUI
        }



        ob_flush();
        flush();
    }
}

?>
    
asked by anonymous 08.07.2017 / 17:23

1 answer

1

Your php.ini settings on your server do not allow you to change the set_time_limit at runtime (direct inside script);

set_time_limit(0); 

You should change this in the php.ini file settings on your server.

The problem is in hosting! However you can comment on your code this line:

set_time_limit(0);

and check if the curl performs perfectly, if not run some hosting allow custom configuration can request with them.

    
08.07.2017 / 17:59