Wordpress 504 Error

I’m trying to update my Wordpress install, I can use the Dashboard fine but when I input my FTP information to update or upload a theme it waits about 2 minutes then returns a 504 error. Any ideas?

in my experience, 504 is usually caused by a problem with the htaccess file. have you changed any recently, especially one located in the FTP directory you are trying to use?

also, check the error logs for more clues