Il problema potrebbe dipendere dal fatto che di default la funzione file_get_contents() non funziona sul protocollo criptato https.
Prova con cURL, una cosa di questo tipo
Codice PHP:
$name = urlencode( 'FIRENZE' );
$baseUrl = 'https://nominatim.openstreetmap.org/search/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPGET,true);
curl_setopt($ch, CURLOPT_URL, $baseUrl.$name);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
...