The problem is that the webserver has strict security about opening an URL from a remote location. In PHP.INI you'll find allow_url_fopen = off. Do NOT change this line as this will make your PHP configuration less secure. I finally found the solution on MamboBear.de
With eWeather and RAF weather it is still possible to open a remote URL.
- Add the PHP CURL module for your webserver (if not present) and restart Apache
- Change line 1645 of /includes/domit/XML_Domit_Parser.php with the following code:
Code:
// return file_get_contents($filename);
//fvt 2006-09-16
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $filename);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
//Fvt end //
It will look like this:
Code:
function getTextFromFile($filename) {
if ($this->doUseHTTPClient && (substr($filename, 0, 5) == 'http:')) {
$this->establishConnection($filename);
}
if ($this->httpConnection != null) {
$response =& $this->httpConnection->get($filename);
$this->httpConnection->disconnect();
return $response->getResponse();
}
else if (function_exists('file_get_contents')) {
//if (file_exists($filename)) {
// return file_get_contents($filename);
//fvt 2006-09-16
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $filename);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
//}
}
else {
require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php');
$fileContents =& php_file_utilities::getDataFromFile($filename, 'r');
return $fileContents;
}