Hi!
I have already tried the simplest php ftp upload script, that works fine on
other hosting. Script example:
// FTP access
$ftp_server = 'HOSTNAME';
$ftp_username = 'USERNAME';
$ftp_password = 'PASSWORD';
// setup of connection
$conn_id = ftp_connect($ftp_server) or die("could not connect to $ftp_server");
// login
ftp_login($conn_id, $ftp_username, $ftp_password);
// If I do "ftp_put" ot any other "ftp_" command, I get 504 Timeout
ftp_close($conn_id);
So yes, without ftp_put or any other commend before ftp_close, all works.
Once I try to upload image or get file list, I receive 504. Meaning the script
gets connected but can't do anything.
Tried to increase the timeout up to 60 seconds in php.ini. All I got is 60
seconds of waiting and then 504 error.
So I assume its something else blocking php ftp_put command.
// Juri
-----Original Message-----
From: Björn Zettergren [mailto:[email protected]]
Sent: Monday, May 16, 2016 5:57 PM
To: Info (ITpartner.ee) <[email protected]>
Cc: Andrew Smalley <[email protected]>; HAProxy <[email protected]>
Subject: Re: HAproxy and ftp_put response "504 Timeout"
On Mon, May 16, 2016 at 4:13 PM, Info (ITpartner.ee) <[email protected]> wrote:
> So FirewallD ports are opened. Doing the same ftp_put via php in active or
> passive mode returns 504 Gateway timeout.
> That’s why I thought mby haproxy doesn't let FTP server response back in to
> server.
>
> Mby you have any other suggestions in this case?
Not knowing how your script works or any more details, i'm guessing that you're
calling it through haproxy via port 80 on a browser, and then it tries to
upload something remotely and won't give any feedback to your client until
upload is finished. If this is the case, you might need to tune "timeout
server". Set at value that's higher than the time it takes for the script to
upload your files to the remote server. But now i'm only guessing.
If i'm wrong, please share more details about the script and how you call it
etc.
/Björn