Blog

De PHP functie ftp_nlist retourneert na enkele minuten deze foutmelding:

Het eerste wat je kan proberen is om de FTP connectie te openen in Passive Mode:

ftp_pasv($conn_id, true);

Controleer je firewall (iptables) op uitgaande FTP connecties:

# FTP
iptables -A INPUT -p tcp -s $IP_DAVID --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -d $IP_DAVID --sport 21 -m state --state ESTABLISHED -j ACCEPT

# FTP (uitgaand)
iptables -A INPUT -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT

# FTP (Active)
iptables -A INPUT -p tcp -s $IP_DAVID --sport 20 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -d --dport 20 -m state --state ESTABLISHED -j ACCEPT

# FTP (Passive)
iptables -A INPUT -p tcp -s $IP_DAVID --sport 1024: --dport 1024: -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -d --sport 1024: --dport 1024: -m state --state ESTABLISHED,RELATED -j ACCEPT
Zoeken