The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    fopen() on Ubuntu!

    Discussion in 'Linux Compatibility and Software' started by crinch, Feb 4, 2008.

  1. crinch

    crinch Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    5
    Hi,

    Sorry, I don't is this place is right for this post but wasted a lot of time to solve this problem.
    I have intalled drupal on Ubuntu and calling a method...

    <?php
    function _send($data, $url)
    {
    if(!function_exists('fopen')):
    exit("fopen function does not exist");
    endif;

    if(!ini_get('allow_url_fopen')):
    exit("allow_url_fopen is not enabled in your php config file");
    endif;

    $handle = fopen("$url?$data", "rb");
    $contents = '';

    while (!feof($handle)) {
    $contents .= fread($handle, 192);
    }

    fclose($handle);

    if(trim($contents) == 0):
    return true;
    endif;

    return false;
    }

    ?>
    When this line is executed...
    $handle = fopen("$url?$data", "rb");
    The page takes too much time, this line is sending request to another site.
    But when I call this function on my local machine using Apache, then this operation is done in normal speed.
    Is there permission problem with the server or something else...

    help is required to solve this problem, thanks in advance.
    CRINCH
     
  2. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    It is probably having issues looking up the URL. It's probably not a permission problem. Try downloading the file at $url?$data in your browser, and see if that times out. If so, that's your problem.
     
  3. crinch

    crinch Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    5
    How can I check it on the server but it is locally running fine using Apache. Please let me know that how to download using this URL.

    CRINCH
     
  4. crinch

    crinch Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    5
    Thank a lot, I have done this using cURL. Now it is not taking much time.

    CRINCH