CAIRO — A boat carrying African migrants headed to Europe capsized off the Mediterranean coast near the Egyptian city of Alexandria on Wednesday, killing at least 42 people, Egyptian authorities said. The army gave the toll in a statement, saying it had “thwarted an illegal immigration attempt” and that the boat had been 12 nautical miles off the coast when it sank. Health Ministry spokesman Khaled Megahed said that the total number of dead was still unknown.