I don't know what would cause that error. The error implies it may have something to do with permissions. Have you tried deleting the live file and then overwriting it?
I also couldn't tell you if it is related to the error when making a database connection (that subsequently causes the header error)
If you give me steps to reproduce the error with a live url and ftp access I can try to look into it.