At least 4,000 people have been evacuated as a forest fire burned out of control on the Spanish island of La Palma, authorities said on Sunday, as Europe struggled to cope with a heatwave.