PHP: ftp_connect - get error information

I am trying to connect to a remote server with ftp_connect and it returns false all the time for this particular server.

Is there a way to get detailed error information? I tried:

error_get_last();

also

 ini_set('display_errors',1);
 error_reporting(E_ALL|E_STRICT);

But that did not work. Any tips?

+4
source share
1 answer

According to PHP docs, it “returns the FTP stream on success or FALSE on error”, so false is the correct result for a connection error. Pay attention to port numbers, firewalls, which can block the connection, blocking IP addresses, etc.

+1
source

All Articles