• Resolved ivalegre

    (@ivalegre)


    I have a problem when opening FB share statistics:
    I get this:

    Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /homepages/***/htdocs/wp-content/plugins/facebook-share-statistics/facebook-share-statistics.php on line 110
    
    Warning: simplexml_load_file(http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fyonkiblog.com%2F,,http%3A%2F%2Fyonkiblog.com%2Fel-amo-del-cuchillo%2F,http%3A%2F%2Fyonkiblog.com%2Fhalloween-adragonado%2F,http%3A%2F%2Fyonkiblog.com%2Fzurullo-con-flor%2F,http%3A%2F%2Fyonkiblog.com%2Fre-leaf%2F,http%3A%2F%2Fyonkiblog.com%2Froyal-mcpapa%2F,http%3A%2F%2Fyonkiblog.com%2Fmanana-parte-jimmy%2F,http%3A%2F%2Fyonkiblog.com%2Fanakin-el-gatico-con-solo-dos-patas-jugando-con-un-sobre%2F,http%3A%2F%2Fyonkiblog.com%2Fagujeros-buenos-para-pajas-pero%2F,http%3A%2F%2Fyonkiblog.com%2Fradicales-modernos%2F,http%3A%2F%2Fyonkiblog.com%2Fverdadera-indiana%2F,http%3A%2F%2Fyonkiblog.com%2Fmacauly-culkin-se-esta-convirtiendo-en-el-viejo-de-solo-en-casa%2F,http%3A%2F%2Fyonkiblog.com%2Fque-si-que-la-abuela-fuma%2F,http%3A%2F%2Fyonkiblog.com%2Fkailashnath-temple-in-maharashtra-india%2F,http%3A%2F%2Fyonkiblog.com%2Fcuando-las-olas-se-congelan-antartida%2F,http%3A%2F%2Fyonkiblog.com%2Fque-hijosputa%2F,) [function.simplexml-load-file]: I/O warning : failed to load external entity "http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fyonkiblog.com%2F,,http%3A%2F%2Fyonkiblog.com%2Fel-amo-del-cuchillo%2F,http%3A%2F%2Fyonkiblog.com%2Fhalloween-adragonado%2F,http%3A%2F%2Fyonkiblog.com%2Fzurullo-con-flor%2F,http%3A%2F%2Fyonkiblog.com%2Fre-leaf%2F,http%3A%2F%2Fyonkiblog.com%2Froyal-mcpapa%2F,http%3A%2F%2Fyonkiblog.com%2Fmanana-parte-jimmy%2F,http%3A%2F%2Fyonkiblog.com%2Fanakin-el-gatico-con-solo-dos-patas-jugando-con-un-sobre%2F,http%3A%2F%2Fyonkiblog.com%2Fagujeros-buenos-para-pajas-pero%2F,http%3A%2F%2Fyonkiblog.com%2Fradicales-modernos%2F,http%3A%2F%2Fyonkiblog.com%2Fverdadera-indiana%2F,http%3A%2F%2Fyonkiblog.com%2Fmacauly-culkin-se-esta-convirtiendo-en-el-viejo-de-solo-en-casa%2F,http%3A%2F%2Fyonkiblog.com%2Fque-si-que-la-abuela-fuma%2F,http%3A%2F%2Fyonkiblog.com%2Fkailashnath-temple-in-maharashtra-india%2F,http% in /homepages/5/***/htdocs/wp-content/plugins/facebook-share-statistics/facebook-share-statistics.php on line 110

    I’ve tried to make a php.ini file with:

    allow_url_fopen=on
    allow_url_include=on

    But still not working. There is any advice or solution to solve this?

    Thank you in advance

    http://wordpress.org/extend/plugins/facebook-share-statistics/

Viewing 1 replies (of 1 total)
  • Thread Starter ivalegre

    (@ivalegre)

    I answer myself. I’ve tried to modify a little bit the plugin to make it work in my hosting (1and1).

    The url request was made using simplexml_load_file, but I don’t know why it’s not working in my site. To avoid this problem, the only thing necessary is change the line 110 of the plugin:

    $xml = simplexml_load_file( 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' . $sUrls );

    by

    $juliUrl = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' . $sUrls ;
    		$ch = curl_init();
    		curl_setopt($ch, CURLOPT_URL, $juliUrl);
    		curl_setopt($ch, CURLOPT_HEADER, false);
    		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    		$xml = curl_exec($ch);
    		curl_close($ch);
    		$xml = new SimpleXMLElement($xml);

    With this it works in my site 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘PHP problem (URL File Access)’ is closed to new replies.