Development PHP: Fatal error:

Discussion in 'Software' started by exile, 6 Apr 2004.

  1. exile

    exile What's a Dremel?

    Joined:
    8 Mar 2004
    Posts:
    46
    Likes Received:
    0
    Fatal error: Maximum execution time of 30 seconds exceeded in /home/wrjou27/public_html/create3.php on line 12



    so why might it do this? :wallbash: :wallbash: :wallbash:
     
  2. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    well giving us the source would help!

    Think of anywhere the code could bomb (go into an infinate loop).

    Something that could be waiting on an operation (such as a socket).
     
  3. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    did you get stuck in a loop somewhere?

    (edit: beaten to it by a fraction of a second :D)
     
  4. exile

    exile What's a Dremel?

    Joined:
    8 Mar 2004
    Posts:
    46
    Likes Received:
    0
    LOL. ya, sorry, the source can be helpfull cant it?

    PHP:

    <?php
    $fp 
    fsockopen("www.wrjournal.net"2083$errno$errstr30);
    if (!
    $fp) {
       echo 
    "$errstr ($errno)<br />\n";
    } else {
       
    $out "GET /frontend/Xskin/mail/doaddpop.html?email=AAtest1&domain=wrjournal.net&password=****y&quota=2 HTTP/1.0\r\n";
       
    $out .= "Authorization: Basic d364bitpassDE=\r\n";
       
    $out .= "Connection: Close\r\n\r\n";

       
    fputs($fp$out);
       while (!
    feof($fp)) {
           echo 
    fgets($fp128);
       }
       
    fclose($fp);
    }
    ?>  
     
    :duh: How could I forget the source? :duh:
     
  5. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    yup its hanging in the while loop whilst waiting for a reply, the fgets function is whats known as a blocking function.
    That is execution hangs there until something is recived, and then its waiting 30 seconds because thats the timeout specified in the fsockopen.

    First off try turning that down to 10 or somthing, as when the timeout error occours you will loose all other info on your page.

    Also if your wanting to just include that page, why not include it?
    from http://uk.php.net/manual/en/function.include.php
    Code:
    // Works.
    include 'http://www.example.com/file.php?foo=1&bar=2';
    
     
  6. exile

    exile What's a Dremel?

    Joined:
    8 Mar 2004
    Posts:
    46
    Likes Received:
    0
    Ya, its going to be included and I think I found the err. On line:
    PHP:
    echo fgets($fp128); 
    I had
    PHP:
    //echo fgets($fp, 128); 
    :wallbash: figures...
     

Share This Page