php - ftp_nlist returning false after connecting successfully -


    <?  //$conn_id = ftp_connect($_get['host'],21,5) or die ('cant connect host!'); $conn_id = ftp_connect($_get['host']) or die ('cant connect host!'); ftp_pasv($conn_id, true); echo 'host ok<br>'; $login_result = ftp_login($conn_id, addslashes($_get['user']), $_get['pass']) or die ('cant connect username/pass!'); echo 'conect ok<br>contents there:';   print_r (ftp_nlist($conn_id,".")); echo '<br />'; if(ftp_put($conn_id, "just-d-test.html", "img/just-d-test.html", ftp_binary)) echo 'put ok'; else print  'put failed!';  echo "<p><hr>"; echo phpinfo(); ?> 

i'm having problem ftp_nlist being returned false.

it connects fine returns put failed (false) latter task.

i've disabled firewall in centos no luck. there nothing disabled in php.ini.

i'm using php 5.3.3. when use filezilla access ftp.xxx loads directory perfect.

does have idea how make work please?

this i'm getting http://www.uploadaphoto.co.uk/images/untitled.jpg

please note ftp_pasv() can called after successfull login or otherwise fail. (source)

try execute ftp_pasv($conn_id, true) after ftp_login() command


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -