php - Issue with cache? -
i'm trying install webviewer teamspeak 3 (a voip program) have issues. first of all, official website has discontinued support of 1 month ago, cannot ask them unfortunately.
when go webviewer page first time seems work fine. if refresh page goes white , loads until get:
php fatal error: maximum execution time of 30 seconds exceeded in c:\users\[...]\tsquery.class.php on line 414
here line 414 file:
$ret .= fgets($this->connection, 8096);
and whole function:
private function send_raw($text) { $i = -1; $ret = ''; if ($this->connection === null) { $this->open_new_connection(); } stream_set_timeout($this->connection, 0, 300000); fputs($this->connection, $text); { $ret .= fgets($this->connection, 8096); } while (strstr($ret, "error id=") === false); return $ret; }
i have tried both on webhost , moving script on same server voip installed on (thinking host might causing something) - no difference.
when put script iframe on webhost , reload page twice whole site goes down!
service unavailable server temporarily unable service request due maintenance downtime or capacity problems. please try again later. apache server @ www.site.com port 80
but own server, every , again (1 / 10 loads or so) get:
php notice: undefined property: tsquery::$cachepath in c:\users\[...]\tsquery.class.php on line 85
and here line 85:
$this->cachepath .= $port . "/";
and whole function:
public function use_by_port($port) { if (is_numeric($port)) { $resp = $this->send_cmd("use port=" . $port); if ($resp['error']['id'] === 0) { $this->cachepath .= $port . "/"; } return $resp; } return false; }
any ideas???
thanks!
do { $ret .= fgets($this->connection, 8096); } while (strstr($ret, "error id=") === false);
the code above means: connect while not first occurence of "error_id=" found (is false). means if no errors occur connect in infinite loop , believe that's why you're getting timeout.
update:
i skip do/while , instead:
if(!$this->connection) return false; $output = fgets($this->connection, 8096); fputs($this->connection, $text); fclose($this->connection); if (substr($output, 0, 4) == '1 ok') return true; return false;
Comments
Post a Comment