Professional Web Applications Themes

execution time??? - PHP Development

Anybody any idea why php stops after 30- 50 secounds? Set_time is set. Max_execution time also. Safe_mode is OFF. [Main File]; <php.... include(function.php); set_time_limit(18000); ini_set('max_execution_time', 18000); ini_set('max_input_time', 18000); error_reporting(0); ignore_user_abort(1); ob_start(); [...] [...] function geturl($url) { global $loadtime; $fd = fopen($url, 'r'); $filecontents = fread($fd, 42930000); fclose ($fd); return $filecontents; } if (is_file("temp/dataimport.dat")) { if(is_file("temp/data.dat")) { $whandle = fopen("temp/data.dat", "r"); $active = fgetc($whandle); fclose($whandle); } $rhandle = fopen("temp/dataimport.dat", "r"); while (!feof($rhandle)) { set_time_limit(1800); $str = fgets($rhandle, 1000); $lang = strlen($str); if ($lang == 0) { echo "File empty."; break; } $url = $str; if ($url != '') { $sql = ...

  1. #1

    Default execution time???

    Anybody any idea why php stops after 30- 50 secounds?
    Set_time is set.
    Max_execution time also.

    Safe_mode is OFF.

    [Main File];
    <php....
    include(function.php);
    set_time_limit(18000);
    ini_set('max_execution_time', 18000);
    ini_set('max_input_time', 18000);
    error_reporting(0);
    ignore_user_abort(1);
    ob_start();
    [...]
    [...]
    function geturl($url)
    {
    global $loadtime;
    $fd = fopen($url, 'r');
    $filecontents = fread($fd, 42930000);
    fclose ($fd);
    return $filecontents;
    }
    if (is_file("temp/dataimport.dat"))
    {
    if(is_file("temp/data.dat"))
    {
    $whandle = fopen("temp/data.dat", "r");
    $active = fgetc($whandle);
    fclose($whandle);
    }
    $rhandle = fopen("temp/dataimport.dat", "r");
    while (!feof($rhandle))
    {
    set_time_limit(1800);
    $str = fgets($rhandle, 1000);
    $lang = strlen($str);
    if ($lang == 0)
    {
    echo "File empty.";
    break;
    }
    $url = $str;
    if ($url != '')
    {
    $sql = "SELECT * FROM links where url='$url'";
    $result1 = mysql_query($sql,$db);
    if (mysql_num_rows($result1)>0)
    {
    $ostr = "Rejected dublicate entry";
    for ($t = 0; $t < 20; $t++)
    {
    $ostr .= "&nbsp;";
    }
    $ostr .= "<br>";
    echo $ostr;
    $berror = 1;
    }
    if ($berror == 0)
    {
    $site = geturl($url);
    $lsite = strtolower($site);
    $pagetime = $loadtime;
    $sql = "INSERT INTO ".$table_pref."links set url='$url'";
    $resultQ = mysql_query($sql,$db);
    }
    flush();
    ob_flush();
    $zcount++;
    }
    fclose($rhandle);

    }


    Dagger Guest

  2. #2

    Default Re: execution time???

    Dagger wrote:
     

    Mine doesn't.

    Have you checked the other links in the chain?

    i.e. the browser (use ignore_user_abort(1);)
    and the web server.

    HTH

    C.
    Colin Guest

  3. #3

    Default Re: execution time???

    > Anybody any idea why php stops after 30- 50 secounds? 


    Maybe theres some time limit set on your web serwer
    (Apache?).

    Hilarion
    Hilarion Guest

  4. #4

    Default Re: execution time???

    "Dagger" <com> wrote in message
    news:42e3f736$0$1147$sunrise.ch... 

    Try moving your 'set-time_limit(18000)' to the very first line of the
    script...

    Norman
    ---
    FREE Avatar hosting at www.easyavatar.com


    Norman Guest

Similar Threads

  1. page execution time
    By Joel Barsotti in forum ASP
    Replies: 2
    Last Post: August 6th, 08:47 PM
  2. Script Execution Time
    By Radek Zajkowski in forum PHP Development
    Replies: 3
    Last Post: July 28th, 09:18 PM
  3. Query execution time?
    By Clive in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 10th, 11:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139