|
Posted by Darko on 11/02/07 19:00
On Nov 2, 4:28 pm, 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
Haven't worked with fsockopen, but I know I hadn't had any problems
with socket_create, socket_connect, gethostbyname, socket_write,
socket_recv, socket_read socket functions family. Maybe you should try
that, it's not so hard. Of course, check if you're opening the correct
port, since it's not a mandatory argument in fsockopen, maybe you
forgot to give the ftp port (it can vary from ftp server to ftp
server, but is often 21, it's standard). Writing php code that relies
on allow_url_fopen maybe isn't that good, since you don't know how
many servers support it.
[Back to original message]
|