If you are importing a large site from wordpress.com using the xml file method, when at stage 2 of the import ( where we download the uploads from wordpress.com site ) if there is over 1gb of uploads on your wordpress.com site, then you may receive a 500 error, dont panic !
This is caused by an apache web server timeout, the download of your uploads is still progressing in the background on our server. You should wait for around 1 hour, then retry the import, if it fails again, repeat the process till it imports successfully.
If you see any messages like : Allowed memory size of 268435456 bytes exhausted, then you should edit the file
wp-includes/default-constants.php
and locate the line :
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
and change this to
define( 'WP_MAX_MEMORY_LIMIT', '1024M' );