You are here: Re: FTP unable to connect with fsockopen « PHP Programming Language « IT news, forums, messages
Re: FTP unable to connect with fsockopen

Posted by C. (http://symcbean.blogspot.com/) on 11/02/07 16:45

On 2 Nov, 15:28, MikeofPet <mike.g...@comcast.net> 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 (see http://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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация