Manual:ImportSites.php

Details
importSites.php maintenance script imports site definitions from XML file into the sites table.

Common error
It comes when the file does not exist or the user running the script does not have permission to read the file.
 * Failed to open $file for writing.

In case file does exist, check file permission. If you are root user then you can run script with sudo.