• 05-10-2010, 17:01:13
    #1
              <?php
    
    $url = "http://weather.yahooapis.com/forecastrss?p=TUXX0014&u=c";
     
    $feed = simplexml_load_file($url);
    if(!$feed) die('Hata var !');
     
    preg_match_all('/<img src="(.*)"\/>/Usi', $feed->channel->item->description,$resimler);
     
    $ch = $feed->channel->item->children('yweather', true);
    $at = $ch->forecast->attributes();
    $att = $ch->condition->attributes();
    $derece = $at->high;
    $edderece = $at->low ;
    $r_kodu = $att->code;
    
    $resim  = $resimler[1][0];
    
     
    ?>

    Arkadaşlar merhaba yukarıdaki gibi bir kod bloğum var havadurumu localde çiçek gibi çalıştığı halde servera atınca aşşağıdaki gibi hata veriyor. Sebebi ve çözümü açıklayabilicek dostlar varsa şimdiden teşekkür ederim. Diğer kişiler içinde yardımcı bi döküm olur mutlaka.

    function.simplexml-load-file]: URL file-access is disabled in the server configuration in /wwwroot1/deneme.com.tr/haberler.php on line 487
    
    Warning: simplexml_load_file(http://weather.yahooapis.com/forecastrss?p=TUXX0014&u=c) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /wwwroot1/deneme.com.tr/haberler.php on line 487
    
    Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://weather.yahooapis.com/forecastrss?p=TUXX0014&u=c" in /wwwroot1/deneme.com.tr/haberler.php on line 487
    Hata var !
  • 05-10-2010, 18:38:17
    #2
    simplexml-load-file fonksiyonunda kullanılan bi fonksiyon, sunucuda yasaklı fonksiyonlar arasındaymış. Muhtemelen file_get_contents fonksiyonu. Sunucu yetkilisiyle görüşüp gerekli fonksiyona sunucuda izin verilmesini isteyin.
  • 06-10-2010, 23:25:39
    #3
    php.ini de allow_url_fopen değeri On olmalı, onu ayarlarsanız düzelir muhtemelen