FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
 Call to undefined function problem View next topic
View previous topic
Post new topicReply to topic
Author Message
AimWDC



Joined: 22 Jul 2009
Posts: 1

PostPosted: Wed Jul 22, 2009 8:01 am Reply with quoteBack to top

Hi

Have installed the script and all seems fine. Added this forum feed via admin and that worked great. However when I try to parse the script using the rss2sql.php file it returns the following error.

updateFeed(3)

Fatal error: Call to undefined function: connection timed out() in /home/aimwebdesiuk/public_html/rss2sql/FeedForAll_XMLParser.inc.php on line 530

Any advice would be appreciated as it looks way too complicated for me to debug!

Thanks,

Simon
View user's profile
markOne



Joined: 02 Aug 2009
Posts: 2

PostPosted: Sun Aug 02, 2009 9:53 am Reply with quoteBack to top

Having the same problem. Line 530 in FeedForAll_XMLParser.inc.php is causing a repetative PHP fatal error which is crashing Cpanel for the server.

The section of code is:
Code:

if ($fd !== FALSE) {
          $request = "GET $thepath HTTP/1.0\r\n";
          $request .= "Host: $domain\r\n";
          $request .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1;) Gecko/2008070208 Firefox/3.0.1\r\n\r\n";
          @fputs($fd, $request);
         
          $headerLine = 0;

          do {
            if (@feof($fd) !== FALSE) {
              // End of file
              break;
            }
            $header = @fgets($fd, 1024);
            if (($header[0] == "\n") || ($header[0] == "\r")) {
              // End of the headers
              break;
            }
            if ($headerLine == 0) {
              $firstHeaderLine = $header;
            }
            $headerLine++;
            if (substr($header, 0, 9) == "Location:") {
              //
              // We got a location header, try to fetch from the new location
              @fclose($fd);
              if (count($RedirectHistory) < 10) {
                $loc = trim(substr($header, 9));
                //
                // Check if the redirect is relative or absolute
                if (substr($loc, 0, 7) != "http://") {
                  if ($loc[0] == "/") {
                    if ($port == 80) {
                      $loc = "http://$domain$loc";
                    } else {
                      $loc = "http://$domain:$port$loc";
                    }
                  } else {
                    //
                    // The path is relative so we need the existing path
                    $path = dirname($parts["path"])."/$loc";
                    if ($port == 80) {
                      $loc = "http://$domain$path";
                    } else {
                      $loc = "http://$domain:$port$path";
                    }
                  }
                }
                for ($x = count($RedirectHistory)-1; $x >= 0; $x--) {
                  if (!strcmp($loc, $RedirectHistory[$x])) {
                    $ReadErrorString = "Redirection loop detected";
                    return FALSE;
                  }
                }
                $RedirectHistory[count($RedirectHistory)] = $loc;
                return h_FeedForAll_fopen($loc, $RedirectHistory);
              } else {
                $ReadErrorString = "Too many redirects";
                return FALSE;
              }
            }
          } while (1);
        } else {
          $ReadErrorString = $errstr($errno);
          return FALSE;
        }


The line
Code:
$ReadErrorString = $errstr($errno);
is causing the error message "PHP Fatal error: Call to undefined function Connection timed out() in /data02/.../public_html/.../XMLParser.php on line 530"

My config settings are:
$useFopenURL = 0;
$XMLfilename = "http://www.yorkm.myzen.co.uk/blog/wp-rss2.php";
$TEMPLATEfilename = "http://www.yorkm.myzen.co.uk/templates/rss-template.html";

and the call in the script is:
<?php
$MAXITEMS = "-7";
$INC_DIR = $_SERVER["DOCUMENT_ROOT"]. "/.../";
include($INC_DIR. "rss2html.php");
?>

Mark
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2782

PostPosted: Sat Aug 15, 2009 3:04 pm Reply with quoteBack to top

An error was found in the rss2html code on line 530. A new version of rss2html has been uploaded, that solves the problem.

However, you may still need to track down a problem. Line 530 is only executed when an error occurs running the script. However, the new (fixed) code will probably give you a better error message, to help figure out what's really happening.

_________________
Create RSS Feeds
Audio Recording and Editing
View user's profile
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme