Title: Facebook Comments Language Errors
Last modified: August 20, 2016

---

# Facebook Comments Language Errors

 *  [ceedubb](https://wordpress.org/support/users/ceedubb/)
 * (@ceedubb)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/)
 * On the settings page I’m getting the following warnings:
 * [http://ceedubb.com/images/fb-comments-error.jpg](http://ceedubb.com/images/fb-comments-error.jpg)
 *     ```
       Warning: DOMDocument::load() [domdocument.load]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /nfs/c02/h06/mnt/28882/domains/ceedubb.com/html/wp-content/plugins/facebook-comments-plugin/class-admin.php on line 198
   
       Warning: DOMDocument::load(http://www.facebook.com/translations/FacebookLocales.xml) [domdocument.load]: failed to open stream: no suitable wrapper could be found in /nfs/c02/h06/mnt/28882/domains/ceedubb.com/html/wp-content/plugins/facebook-comments-plugin/class-admin.php on line 198
   
       Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://www.facebook.com/translations/FacebookLocales.xml" in /nfs/c02/h06/mnt/28882/domains/ceedubb.com/html/wp-content/plugins/facebook-comments-plugin/class-admin.php on line 198
       ```
   
 * [http://wordpress.org/extend/plugins/facebook-comments-plugin/](http://wordpress.org/extend/plugins/facebook-comments-plugin/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Alex Moss](https://wordpress.org/support/users/alexmoss/)
 * (@alexmoss)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/#post-3165834)
 * We have seen one other person with this issue and we found that this was because
   phpxml is not installed on your server. You can tell your host to get this installed.
   Details are here:
    [http://stackoverflow.com/questions/10693771/cakephp-class-domdocument-not-found](http://stackoverflow.com/questions/10693771/cakephp-class-domdocument-not-found)
 * In the meantime we’re working on an alternative for you and will get an update
   for it as soon as possible.
 *  [jwheck](https://wordpress.org/support/users/jwheck/)
 * (@jwheck)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/#post-3165837)
 * Since my webhost will not install phpxml in the name of security, I made a workaround
   by downloading [http://www.facebook.com/translations/FacebookLocales.xml](http://www.facebook.com/translations/FacebookLocales.xml)
   and copying the file the the facebook-comments-plugin folder on my server.
 * Then I edited the code in class-admin.php starting at line 194:
 *     ```
       $blog_url = get_bloginfo('wpurl'); // get blog URL (ex: http://mywebsite.com)
       $plugin_url = plugin_dir_url(__FILE__); // get plug-in URL (ex: http://mywebsite.com/wp-content/plugins/facebook-comments-plugin/ )
       $plugin_url = str_replace($blog_url, '..', $plugin_url); // strip out blog URL so load command will look for local file
       $dom_object->load($plugin_url."FacebookLocales.xml"); // load local file
       ```
   
 * Another (and IMHO, better) option would to use cURL (which my webhost does allow)
   for loading external files.
    First add the following function:
 *     ```
       /*
        * curl_get() to perform curl call to get external file and return as string
        * Copied from http://php.net/manual/en/function.curl-exec.php#98628
   
        */
       function curl_get($url, array $get = NULL, array $options = array())
       {
           // added line below to handle http_build_query() warning
           if (!empty($get)) $httpbuildquery = http_build_query($get);
   
           $defaults = array(
               CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). $httpbuildquery,
               CURLOPT_HEADER => 0,
               CURLOPT_RETURNTRANSFER => TRUE,
               CURLOPT_TIMEOUT => 4
           ); 
   
           $ch = curl_init();
           curl_setopt_array($ch, ($options + $defaults));
           if( ! $result = curl_exec($ch))
           {
               trigger_error(curl_error($ch));
           }
           curl_close($ch);
           return $result;
       }
       ```
   
 * Next change line 198 from
    `$dom_object->load("http://www.facebook.com/translations/
   FacebookLocales.xml");` to
 *     ```
       $FacebookLocalesXML = curl_get("http://www.facebook.com/translations/FacebookLocales.xml");
       $dom_object->loadXML($FacebookLocalesXML);
       ```
   
 *  [belgianwolfie](https://wordpress.org/support/users/belgianwolfie/)
 * (@belgianwolfie)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/#post-3165848)
 * [@jwheck](https://wordpress.org/support/users/jwheck/)
    thanks for 1) solving
   the issue (I had the same issue) thanks for 2) coming back here, posting and 
   sharing your (working) solution.
 * above solution should (obviously) be added to facebook-comments-plugin/class-
   admin.php
 *  [m_disseny](https://wordpress.org/support/users/m_disseny/)
 * (@m_disseny)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/#post-3165854)
 * Same issue here, cURL fix worked for me.
 * Thanks a lot for sharing this [@jwheck](https://wordpress.org/support/users/jwheck/)!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Facebook Comments Language Errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facebook-comments-plugin_577794.svg)
 * [Facebook Comments](https://wordpress.org/plugins/facebook-comments-plugin/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-comments-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-comments-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-comments-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-comments-plugin/reviews/)

 * 4 replies
 * 5 participants
 * Last reply from: [m_disseny](https://wordpress.org/support/users/m_disseny/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/facebook-comments-language-errors/#post-3165854)
 * Status: not resolved