help with php ftp functions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joran420
Forum Newbie
Posts: 8
Joined: Wed Apr 04, 2007 8:06 pm

help with php ftp functions

Post by joran420 »

Ive searched high and low and cant find any answers...maybe ill luck out and someone here will have some suggestions
using the code
<?
$conn =ftp_connect($hostname,21)
echo ftp_login($conn,$user,$pass); // echos 1 as long as the credentials are right so its letting me login
ftp_pasv($conn,false);

//this stuff hangs and timesout no matter what
ftp_rawlist($conn,"/");
ftp_nlist($conn,".")
ftp_put($conn,$local,$remote,7777);

any time i try and list or to put a file it hangs...it actually creates the file on the ftp server it just doesnt upload any data to the file (0bytes totally empty file)
I can create directories and change directories but I cant seem to put a file on the server no matter what...
i tried some methods with fsockopen that led to the same hangup as soon as i try to write to a file....

oh maybe its file permissions? but since im logging in with my ftp credentials shouldnt my ftp session have the same permissions as my user account im loggin in with?
anyway ive been hammering at this for like a week and just going in circles....
enable-ftp has been compiled into my php build (godaddy hosting)

so please if anyone knows or even has any ideas?? pretty please
joran420
Forum Newbie
Posts: 8
Joined: Wed Apr 04, 2007 8:06 pm

Re: help with php ftp functions

Post by joran420 »

this is only happening on WINDOWS_NT systype's
on UNIX machines it connects fine but when the host ftp is windows it just totally times out

dunno is there some other windows machine specific ftp directions?
like i said works fine when i connect to a unix machine
Post Reply