Re: FTP unable to connect with fsockopen



On Nov 2, 9:45 am, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@xxxxxxxxx> wrote:
On 2 Nov, 15:28, MikeofPet <mike.g...@xxxxxxxxxxx> wrote:

I am trying to implement FTP in a PHP script but am unable to make the
connection to the remote server. The connection step times out at the
fsockopen function. I am not sure if it is relevant but PHP is
configured with "allow_url_fopen" ON. I am able to do an FTP connect
using an FTP client and using the same host/username/password
parameters.

Any ideas would be appreciated.

Thanks

It's difficult to say what's happenning without a lot more info, but I
can't help thinking you're making life a lot more difficult than it
needs to be: allow_url_fopen option applies to the file access
wrappers - not fsockopen - but I'd be using the file wrappers method
in preference to implementing my own protocol stack (particularly with
FTP) - but even then I'd prefer to implement it using the curl
library.

When you say it works an FTP client - I assume you are using it
interactively from the command line - try executing it from within
your script (seehttp://www.php.net/manual/en/ref.exec.php). Note most
versions of the ftp client will happily work with input from a file
redirected to STDIN

C.

Thank you for comments - very helpful.

.



Relevant Pages

  • Re: FTP unable to connect with fsockopen
    ... The connection step times out at the ... fsockopen function. ... wrappers - not fsockopen - but I'd be using the file wrappers method ... When you say it works an FTP client - I assume you are using it ...
    (comp.lang.php)
  • Re: he hammer mine ftp-server how can i block that ip
    ... > but when the server is full than try the users login ... > that do slow me bandwitch a lot ... only one connection is allowed. ... an FTP client like Gozilla or one of the other windows clients. ...
    (alt.os.linux.suse)
  • Re: he hammer mine ftp-server how can i block that ip
    ... > but when the server is full than try the users login ... > that do slow me bandwitch a lot ... only one connection is allowed. ... an FTP client like Gozilla or one of the other windows clients. ...
    (comp.os.linux.security)
  • Re: he hammer mine ftp-server how can i block that ip
    ... > but when the server is full than try the users login ... > that do slow me bandwitch a lot ... only one connection is allowed. ... an FTP client like Gozilla or one of the other windows clients. ...
    (comp.os.linux.networking)
  • Re: FTP unable to connect with fsockopen
    ... Learn about these two PHP functions: ... connection to the remote server. ... The connection step times out at the ... fsockopen function. ...
    (comp.lang.php)