LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2005, 10:57 AM   #1
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Rep: Reputation: 15
problem with fsockopen


hello,

i just installed the Multi-router looking glass from http://pilot.org.ua/mrlg/ and i was trying to configure it and i got this error:

Warning: fsockopen(): php_hostconnect: connect failed in /home/httpd/html/cisys/mrlg/mrlg.php on line 269

Warning: fsockopen(): unable to connect to x.x.x.x:23 in /home/httpd/html/cisys/mrlg/mrlg.php on line 269
Error connecting to router

this is the line 269.
// All Ok, do telnet
$address = $router[$routerid]["address"];
if (!empty ($router[$routerid][$handler . "_port"]))
$port = $router[$routerid][$handler . "_port"];
else
$port = $router["default"][$handler . "_port"];
if (!empty ($router[$routerid][$handler . "_password"]))
$password = $router[$routerid][$handler . "_password"];
elseif (!empty ($router[$routerid]["password"]))
$password = $router[$routerid]["password"];
else
$password = $router["default"]["password"];
$command = $request[$requestid]["command"] . (!empty ($argument) ? (" " . safeOutput ($argument)) : "");
$link = fsockopen ($address, $port, $errno, $errstr, 5);-----269----
if (!$link)
{
printError ("Error connecting to router");
return;
}
socket_set_timeout ($link, 5);
$username = $router[$routerid]["username"];
if (!empty ($username)) fputs ($link, "{$username}\n");
fputs ($link, "{$password}\nterminal length 0\n{$command}\n");
// let daemon print bulk of records uninterrupted
if (empty ($argument) && $request[$requestid]["argc"] > 0) sleep (2);
fputs ($link, "quit\n");
echo "<pre>\n";
while (!feof ($link)) $readbuf = $readbuf . fgets ($link, 256);
$start = strpos ($readbuf, $command);
$len = strpos ($readbuf, "quit") - $start;
while ($readbuf[$start + $len] != "\n") $len--;
echo substr($readbuf, $start, $len);
echo "</pre>\n";
fclose ($link);
}


so, anyway, i was searching aroud and i found that it was some kind of bug in php......

can anybody help me??
 
Old 08-25-2005, 11:55 AM   #2
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Original Poster
Rep: Reputation: 15
i solved it....

i permit the ip of my server on the router to a telnet...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why fsockopen() use root dns info?? - about php chtla Linux - Software 0 04-13-2004 11:42 PM
Php Fsockopen jinksys Programming 0 02-08-2004 06:04 AM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM
PHP - fsockopen() + Redhat8 aspr Linux - Networking 0 06-03-2003 03:15 PM
php - fsockopen cbe Programming 1 07-16-2001 05:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration