Hi Guys,

I am getting the following errors on this page (/admin/settings/fb/social/settings)

* warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /usr/www/users/icdiry/sites/all/modules/fb_social/fb_social.admin.inc on line 80.
* warning: simplexml_load_file(http://www.facebook.com/translations/FacebookLocales.xml) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /usr/www/users/icdiry/sites/all/modules/fb_social/fb_social.admin.inc on line 80.
* warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://www.facebook.com/translations/FacebookLocales.xml" in /usr/www/users/icdiry/sites/all/modules/fb_social/fb_social.admin.inc on line 80.
* warning: Invalid argument supplied for foreach() in /usr/www/users/icdiry/sites/all/modules/fb_social/fb_social.admin.inc on line 81.

I enabled allow_url_fopen but I believe it is unrelated.

I searched for a solution; but no one else has the same error as far as I can tell.

It would be most appreciated if you can shed some light on this matter.

Thanks in advance

JCB

Comments

ferdi’s picture

I would try again to set allow_url_fopen = ON in PHP configuration (php.ini).

egomac’s picture

Are you on PHP4?

kars-t’s picture

Status: Active » Needs review
StatusFileSize
new922 bytes

Here is a patch for the problem.

We can use drupal_http_request to avoid using the fopen wrappers. This method uses socket connect. The patch might be extended to do a response code check if it's 200.

ferdi’s picture

kars-t’s picture

Status: Needs review » Closed (fixed)

Great thanks! :D

I close this.

jakedeg’s picture

I did apply the patch and Terminal told me it was successful. I then re-uploaded the module via FTP but I am still getting the following error message when I click the FB social settings button:

Fatal error: Call to undefined function: simplexml_load_file() in /home/nydac02/public_html/sites/all/modules/fb_social/fb_social.admin.inc on line 80

jakedeg’s picture

Status: Closed (fixed) » Needs work
kars-t’s picture

Status: Needs work » Closed (works as designed)

Hi,

first of all the patch doesn't seem to be applied correctly because simplexml_load_file() is no longer used but simplexml_load_string().

And the function is part of standard PHP5.
http://www.php.net/manual/en/simplexml.requirements.php

So if your PHP Version does not already implement simplexml it means you are using PHP 4 or a version that was builded without simplexml.

As this module did use simplexml from the begining maybe there should be a notice like "fb_social is PHP 5 only". But otherwise this works as intended.

jakedeg’s picture

Yup. I'm on PHP 4. That's the problem. Thanks for the help.