Need help fixing a wordpress plugin error.

Discussion in 'PHP' started by sweet jesus, Jul 7, 2009.

  1. #1
    Some wordpress plugin I got is throwing me an error and keeps crashing my server.

    I know what lines the error is coming from I just dont know how to fix it.

    I have attached the php file that I am trying to fix. I am also attaching a zip file with all the plugins files, just as I downloaded it.

    It keeps getting stuck in a loop which is filling up my error logs with GB of info just repeating the same error over and over again.

    The Error is:

    [07-Jul-2009 04:29:24] PHP Warning: feof(): supplied argument is not a valid stream resource in /home/watchfre/public_html/wp-content/plugins/IMDB_Tag/IMDB_Tag.php on line 436

    [07-Jul-2009 04:29:24] PHP Warning: fgets(): supplied argument is not a valid stream resource in /home/watchfre/public_html/wp-content/plugins/IMDB_Tag/IMDB_Tag.php on line 437

    One other note, I also had to add a php.ini file into the same directory as the attached php. Akk the php.ini file contained was this line of code:
    allow_url_fopen (http://nl2.php.net/filesystem)


    If anybody knows how I can fix this please let me know. I have been trying things for hours and have not gotten anywhere. Once I added the php.ini some more info showed up, but then it went back into the endless loop again.

    Thank You,
    Sweet Jesus
     

    Attached Files:

    sweet jesus, Jul 7, 2009 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    What are on line 436 & 437?
    I am too lazy to download the attachment :D
     
    xrvel, Jul 7, 2009 IP
  3. sweet jesus

    sweet jesus Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here is lines 436 and 437 and some of the code surrounding it.

    	
    (433)      $imdb_url = "http://imdb.com/title/tt".$imdb_id."/";
    (434)
    (435)      $imdb = @fopen($imdb_url, "r");
    (436)      	      while (!feof($imdb))
    (437)		      $imdb_raw .= fgets($imdb, 4096);
    (438)		      fclose($imdb);
    (439)      $imdb_raw=str_replace("\n","",$imdb_raw);
    
    Code (markup):
    Let me know if you need anything else
     
    sweet jesus, Jul 7, 2009 IP
  4. tmsfactory.com

    tmsfactory.com Banned

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if thats a plugin, deactivate it first then try to check again its installation file
    I guess you have php.ini error since your trying to modify it and it needs to restart httpd server
     
    tmsfactory.com, Jul 7, 2009 IP
  5. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #5
    Modify the line into this one

    
    (433)      $imdb_url = "http://imdb.com/title/tt".$imdb_id."/";
    (434)      echo "<p>$imdb_url</p>";
    (435)
    (436)      $imdb = @fopen($imdb_url, "r");
    
    Code (markup):
    And you will get an URL in your browser.
    Try to open it manually with your browser.

    Does it return "Not Found" result?
    Or it does exist?
     
    xrvel, Jul 7, 2009 IP