Jump to content

Recommended Posts

Hi all we are currently getting problems loading a telnet application using PHP we are getting the following time out error whilst trying to the script?

 

Could anyone have a look and see if they could shed some light on the issue we are having.

 

 

THE CODE

 

<?php
 
$cfgServer = "cuckoo.ltraffic.co.uk";  //IP of your router
$cfgPort    = 23;                //port, 22 if SSH
$cfgTimeOut = 30;
 
$usenet = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut);
 
if(!$usenet)
        {
        echo "Connection failed\n";
        exit();
        }
else
        {
        echo "Connected\n<BR>";
        fputs ($usenet, "site12\r\n");
        fputs ($usenet, "wargon\r\n");
        $start = NULL;
        $timeout = ini_get('default_socket_timeout');
while(!safe_feof($usenet, $start) && (microtime(true) - $start) < $timeout)
                {
                echo "+++ ".fgets($usenet, 4096)." +++<BR>\n";
                }
        }
 
function safe_feof($fp, &$start = NULL) {
           $start = microtime(true);
        return feof($fp);
        }
?>
 
 
 
THE ERROR
 
Connected 
+++ +++
+++ Cuckoo Login: +++
+++ Password: +++
+++ Connected to Cuckoo: +++
+++ +++

Fatal error: Maximum execution time of 60 seconds exceeded inC:\Inetpub\vhosts\ltraffic.co.uk\cuckoo.ltraffic.co.uk\map\telnet.php on line 103
Edited by aelouch001
Link to comment
https://forums.phpfreaks.com/topic/284693-php-telnet-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.