Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-10-24 12:10:34

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Timeout error

Trying to help someone diagnose a server error message – running a 4.4.1 install.

Fatal error: Maximum execution time of 60 seconds exceeded in /users/home/username/web/public/textpattern/lib/txplib_misc.php(653) : eval()'d code on line 54

Sometimes throws a 500 error too. While checking on this (web server is Joyent), has anyone else come across this timeout error before? It suggests that php may have run out of time trying to process a script or plugin….

Any ideas? Hoping to save time finding the cause…!

Offline

#2 2012-10-24 12:44:14

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Timeout error

Oh that’s great. Now I’m getting 500 errors on TXP Tips. Only change on that site was to upgrade to TXP 4.5.2. Either this is a Joyent problem or a TXP file I guess.

Offline

#3 2012-10-24 12:59:10

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Timeout error

Try disabling plugins one by one until the issue disappears. The issue does arise from a plugin.

You can still access and disable plugins by directly going to the Plugins panel’s URL, e.g. /admin/?event=plugin.

Last edited by Gocom (2012-10-24 13:02:17)

Offline

#4 2012-10-24 13:21:07

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Timeout error

Yes its a bit strange because on both sites I’m able to work with TXP Admin without any issues. Just enabled error logging to file, and get this for TXP Tips (note it runs on a multi-site install):

[24-Oct-2012 13:11:21] PHP Notice:  Constant txpath already defined in /users/home/username/domains/txptips.com/web/private/config.php on line 11
[24-Oct-2012 13:11:21] PHP Warning:  include(1) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /users/home/username/domains/txptips.com/web/public/index.php on line 27
[24-Oct-2012 13:11:21] PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening '1' for inclusion (include_path='.:/usr/local/lib/php') in /users/home/username/domains/txptips.com/web/public/index.php on line 27

For the other site, no upgrade was performed so I would imagine it is a plugin. I’ll create error logs and report back..

Offline

#5 2012-10-24 13:31:21

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Timeout error

Mmm. htn_feedstats seems to be the culprit on both sites.

Offline

#6 2012-10-24 13:41:38

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Timeout error

Strange. Must be an issue with Feedburner unless the plugin code is suddenly out of date:

function htn_feedstats($atts) {
	extract(lAtts(array(
		'id' => '',
		'name' => '',
		'cache' => 1,
		'cachetime' => 21600,
		'cachefile' => 'files/feedcache.txt',
		'show' => 'readers'
	),$atts));
	if(!$id || !$name) { $error = "[No FeedID]"; }
	$apiurl='http://api.feedburner.com/awareness/1.0/GetFeedData?';

	if(!empty($name)) { $check = $apiurl.'uri='.$name; }
	if(!empty($id))   { $check = $apiurl.'id='.$id; }

	if($cache == true && file_exists($cachefile)) {
		$duration = time()-$cachetime;
		$array = @file($cachefile);
		$feedcount = array(
				"readers" => $array[1],
				"hits" => $array[2],
				"reach" => $array[3],
				"errors" => $array[4],
			);
		if($array[0] <= $duration){
			$feedcount = _getfeeddata($check);

$data=time()."\n".$feedcount["readers"]."\n".$feedcount["hits"]."\n".$feedcount["reach"]."\n".$feedcount["errors"];

			if(!empty($feedcount["readers"])) {
				$fp = fopen ($cachefile, "w");
				fwrite ($fp , $data);
				fclose ($fp);
			}
		}
		if($feedcount["errors"] != "[None]") {
			return $feedcount["errors"];
		} else {
			return $feedcount[$show];
		}
	} else {

		$feedcount = _getfeeddata($check);
		if($feedcount["errors"] != "[None]") {
			return $feedcount["errors"];
		} else {
			return $feedcount[$show];
		}
	}
}

function _getfeeddata($check) {
	$handle = fopen ($check, "r");
	while (!feof($handle)) {
		$buffer .= fgets($handle);
	}
	fclose ($handle);
	if(empty($buffer)){
		$buffer = file_get_contents($check,'r');
	}
	if(empty($buffer)){
		$c = curl_init($check);
		curl_setopt($c, CURLOPT_RETURNTRANSFER,1);
		$buffer = curl_exec($c);
		curl_close($c);
	}

	if(empty($buffer) || eregi('stat\=\"fail\"',$buffer)){
		$array["errors"] = "[No Data]";
	} else {$array["errors"] = "[None]";}

	preg_match('/circulation\=\"([0-9\.]+)\"/si', $buffer, $x);
	$array["readers"] = $x[1];
	preg_match('/hits\=\"([0-9\.]+)\"/si', $buffer, $y);
	$array["hits"] = $y[1];
	preg_match('/reach\=\"([0-9\.]+)\"/si', $buffer, $z);
	$array["reach"] = $z[1];

	return $array;
}

Offline

#7 2012-10-24 14:23:06

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Timeout error

Google turned off Feedburner’s API on 20 October. I suspect that’s the root of your problem.

Offline

#8 2012-10-24 14:46:19

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Timeout error

Hi Joe, must be. They must have turned it off after the 20th though. I’d read something about Feedburner being possibly closed but forgot all about it as it was a while ago.

Offline

#9 2012-10-24 15:36:02

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Timeout error

They announced closure and deprecated the API early 2011. FeedBurner’s support channels and localized domains where closed during the last summer. I would encourage looking at alternatives, for Textpattern, I would just link to the feed directly.

Offline

Board footer

Powered by FluxBB