Php curl crawls the page, which is accessible, but displays 500error

< hr > This internal server error error occurs when < H2 > climbs to a range of $I between 35 and 45. < / H2 > < hr >

clipboard.png

class Pacong extends Base
{

public function test(){
    header("content-type:text/html;charset=utf-8");
    set_time_limit(0); //
    ini_set("memory_limit", "-1"); //

    $array=[0=>"https://haikou.anjuke.com/ask/fl-qita/p",
        1=>"https://haikou.anjuke.com/ask/fl-daikuan/p",
        2=>"https://haikou.anjuke.com/ask/fl-maifang/p",
        3=>"https://haikou.anjuke.com/ask/fl-maifanga/p",
        4=>"https://haikou.anjuke.com/ask/fl-zufang/p",
        5=>"https://haikou.anjuke.com/ask/fl-jiaoyiguohu/p"];
    foreach ($array as $k=>$v) {
      //  echo $v;
        $header=array();
        for ($i = 1; $i < 100; $iPP) {
           // sleep(5);
            echo $i;
            $curlobj = curl_init();
            //url
            curl_setopt($curlobj, CURLOPT_URL, $v . $i . "/");
            //echo $array["0"] . $i . "/";
            curl_setopt($curlobj, CURLOPT_TIMEOUT, 0);
            curl_setopt($curlobj, CURLOPT_CONNECTTIMEOUT, 0);
            //
            curl_setopt($curlobj, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($curlobj, CURLOPT_HEADER, 1);
            //curl_setopt($curlobj, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($curlobj,CURLOPT_HTTPHEADER,$header);
                curl_setopt($curlobj,CURLOPT_COOKIE,"aQQ_ajkguid=65E1E78E-6422-B2AF-B73F-000C2FA17625; ctid=49; 58tj_uuid=dfc8d57c-c982-4cb0-9693-9e3b688e6d97; als=0; _ga=GA1.2.1683086249.1524535452; _gid=GA1.2.785162605.1524535452; isp=true; lps=http%3A%2F%2Fhaikou.anjuke.com%2Fask%2Ffl-qita%2Fp30%7C; twe=2; sessid=39A3A71B-0A07-8C1E-1B9D-9409C5F93F8B; init_refer=; new_uv=5; new_session=0; __xsptplusUT_8=1; __xsptplus8=8.5.1524622380.1524623253.8%234%7C%7C%7C%7C%7C%23%23yn1dRjCaHplJ6-hXacmy8mfcE82lTJHz%23;");

                curl_setopt($curlobj, CURLOPT_SSL_VERIFYPEER, false); // 
            curl_setopt($curlobj, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
            $output = curl_exec($curlobj);  //
                $info = curl_getinfo($curlobj);
                print_r($info);
                echo "
";print_r(curl_error($curlobj));echo "
"; Echo "
";print_r(curl_getinfo($curlobj));echo "
"; Echo "
";print_r($header);echo "
"; Curl_close ($curlobj); / / close curl } } } }
Php
Mar.05,2021

it is possible that the server has made an anti-crawler judgment, that is, if frequent visits are detected and some features are added, a href= "http://php.net/manual/zh/function.curl-getinfo.php" rel=" nofollow noreferrer "> curl_getinfo

will be returned.
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 

how do I catch this 500 error? I want to catch this 500, and then continue; or sleep (30)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b295-2c287.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b295-2c287.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?