Failed to upload wordpress theme

failed to upload wordpress theme .
getting below mentioned error :

Failed to connect to FTP Server localhost:21

third party theme want to upload -

Use this code in your wp-config file:-

define(‘FS_METHOD’, ‘direct’);

I think it should resolve your problem. If not then it may be permission issue with your wordpress folder.


Maybe the .zip file is corrupt, is not properly uploading, or you don’t have sufficient space on your server to hold and unzip it.

Unzip the file locally and then upload it to the resulting directory to wp-content/themes on your server using FTM.

The reason for moving to WordPress managed hosting is that all the process of installing WordPress and theme went more easier through the managed platform.