ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-windows
php-windows
RE: [PHP-WIN] ftp_connect() failed
by Mike Matz other posts by this author
Dec 13 2006 3:24PM messages near this date
[PHP-WIN] 4.4.4 with SSL enabled | Re: [PHP-WIN] Class method unavailable on server
Could it be the FTP server throttling repeated connects from the same
IP?  Have you tried on different FTP server software? 

-----Original Message-----
From: Alek Silverstone [mailto:alek.silverstone@[...].com] 
Sent: Friday, December 08, 2006 8:01 AM
To: php-windows@[...].net
Subject: [PHP-WIN] ftp_connect() failed

<?php
  set_time_limit(0);
  $i=1;

  while (TRUE)
  {
    $date=date('H:i:s');
    $ftp=ftp_connect('127.0.0.1',21,10);
    if ($ftp) $login=ftp_login($ftp,'anonymous',$i);
    if ($ftp && $login)
    {
      if (($i % 100) === 0) echo "[$date] $i - online.\n";
    } else {
      echo "[$date] $i - offline.\n";
      break;
    }
    if ($ftp!==FALSE) ftp_close($ftp);
    $i++;
  }
?> 

This script failed after 100-10000 loops.
Tested on various servers and OSes.

What's wrong?

--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved