Problem with free search script

Discussion in 'Products & Tools' started by BobSY, Jul 29, 2005.

  1. #1
    I installed the free script found here --http://www.digitalpoint.com/tools/search -- a few months ago at two sites and it had been working fine. When I checked one site yesterday, I found the script was returning an error:
    Warning: feof(): supplied argument is not a valid stream resource in xxxx

    Any idea why this is occuring? Could digitalpoint be blocking my site for some reason? Thanks.
     
    BobSY, Jul 29, 2005 IP
  2. BobSY

    BobSY Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    OK, I removed the @ from fopen and now I get this error (with * masking the real key and site)

    Warning: fopen(http://search.digitalpoint.com/?q=test&key=*********************&site=**************&start=0&spell=1): failed to open stream: Bad file descriptor in *************\search.php on line 44
     
    BobSY, Jul 29, 2005 IP
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is allow_url_fopen set to "1"? you can check this with ini_get ('allow_url_fopen'); and change it with ini_set ('allow_url_fopen', '1'); Also, the DP servers will probably block you if you don't have the link back to digitalpoint.com as explained here
     
    exam, Jul 29, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Definitely check the allow_url_fopen stuff.
     
    digitalpoint, Jul 29, 2005 IP
  5. BobSY

    BobSY Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks. I'm an asp developer and don't know php at all really. I do have the following code in the script- Is this what you mean:

    ini_set ("allow_url_fopen", "1");
    if (!ini_get ("allow_url_fopen")) echo '<FONT COLOR=RED><B>Sorry, this PHP configuration does not allow for usage of <A HREF="http://www.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen" TARGET="_blank">fopen()</A>, which is required for this search engine script.</B></FONT><P>';

    // Let's get the results
    $handle = @fopen ("http://search.digitalpoint.com/?q=" . urlencode ($q) . "&key=" . urlencode ($key) . "&site=" . urlencode ($site) . "&start=" . min (990, $start) . "&spell=" . $spelling, "r");
    while (!feof ($handle) && $handle) {
    $line .= fgets ($handle, 1024);
    }
    fclose($handle);
     
    BobSY, Aug 4, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    It would be a server config issue, nothing with the script itself.
     
    digitalpoint, Aug 4, 2005 IP
  7. BobSY

    BobSY Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks Shawn. I tried fopen against another url and it seemed to work fine, so something is blocking access from my site to search.digitalpoint.com. My host says they are not blocking anything.
    I did put a link back to digitalpoint on my search results page, but now I see that your requirement is to put the link on the search input page. Could digitalpoint be blocking my ip for failing to adhere to this requirement?
     
    BobSY, Aug 4, 2005 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    What's the address of the site? I'll check it on this end.
     
    digitalpoint, Aug 4, 2005 IP
  9. BobSY

    BobSY Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    It's jlysl.org
     
    BobSY, Aug 5, 2005 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    Nope, not being blocked on this end.
     
    digitalpoint, Aug 5, 2005 IP
  11. mahmed

    mahmed Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    hi,:)
    i have the same problem, i set the allow_url_fopen to 1 but still the same error

    Warning: feof(): supplied argument is not a valid stream resource
    Warning: fclose(): supplied argument is not a valid stream resource
    Parse error: parse error ... : eval()'d code on line 1


    any help.

    Thanks :confused:
     
    mahmed, Dec 6, 2005 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    If the server admin doesn't allow fopen for URLs globally, you wouldn't be able to set it manually (unfortunately).
     
    digitalpoint, Dec 6, 2005 IP
  13. mahmed

    mahmed Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    You are right, but the search was working before one week.
    maybe digitalpoint blocking my site because till now i didn't adhere to my search page.

    Can you check if my site is blocked or not.
    my site is: www.eschool.gov.sa

    Thanks
     
    mahmed, Dec 6, 2005 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    Nothing was changed on this end.
     
    digitalpoint, Dec 6, 2005 IP
  15. mahmed

    mahmed Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Actually I don't have experience in php, still search retrieve the same error.
    do you have any solution for that.

    Thanks in advance.
     
    mahmed, Dec 6, 2005 IP
  16. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #16
    Try removing the @ symbol before the fopen() function and see if it yields anything different.
     
    digitalpoint, Dec 6, 2005 IP
  17. mahmed

    mahmed Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    it return
    Warning: fopen(http://search.digitalpoint.com/?q=...): failed to open stream: Bad file descriptor in xxx on line 43
     
    mahmed, Dec 6, 2005 IP
  18. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #18
    Yeah it's the fopen problem... need to talk to your server admin about letting you use URLs within fopen().
     
    digitalpoint, Dec 6, 2005 IP