3
I’ve tried with ftp_nlist() and with ftp_rawlist() but the return is always an empty array.
The Access/Authentication question is ok, you will only try to read a list if it already connected with a user:
Example:
$dados = array('host' => 'localhost', 'usuario' => 'teste', 'senha' => '123456');
$conn = ftp_connect($dados['host']);
if (ftp_login($conn, $dados['usuario'], $dados['senha'])):
// var_dump(ftp_nlist($conn, '.'));
var_dump(ftp_rawlist($conn, '/'));
endif;
Already tried using passive mode: ftp_pasv($Conn, true);
– Ivan Nack
I even tried but my problem at first is not this ftp_pasv is good for when you have firewall but ftp I created and on my own machine
– Gabriel Rodrigues
Other ftp functions like ftp_get work: ftp_get($Conn, 'arquivolocal.Xyz', 'arquivoremoto.Xyz', FTP_ASCII, 0) ?
– Ivan Nack
Already checked if you are allowed to list on FTP?
– Ivan Nack
yes, because if I do an ftp://user:password@localhost I can authenticate and view all folders, I asked a colleague of mine to access my ip and it worked too
– Gabriel Rodrigues