You are hereForums / Projects / Photopic / Sorry, did not manage to load the albums. (XML cannot be loaded)
Sorry, did not manage to load the albums. (XML cannot be loaded)
Hi,
I get the error: "Sorry, did not manage to load the albums. (XML cannot be loaded)"
Can you tell me more about how I can fix this problem?
My website is: http://davinia.nl/site/photopic
My hostingprovider says that that isn't enough information. They need to know exactly what it is that is blocking the script.
They need to know which functions the scipt calls?? (I don't know what that means)
http://www.davinia.nl/n.php --> is an overview of my phpinfo
Can you see what is wrong there?
Davinia,
I am using Simple XML to load the XML from google servers as the following piece of code shows.
@ $sxml = simplexml_load_file($feedurl);
If the content is empty photopic displays 'xml cannot be loaded'.
See if that helps them find out why this is happening.
I can recall an email that I received about a similar issue and the user found out that their host did not allow accessing xml using that simplexml function - not sure about the reason.
Kevin
Hi,
The function used in your script cannot be activated on my server. Apparently it is considered as a securityrisk. I'm told to rewrite the script using curl?! though I have no idea how I'm supposed to do that.
They gave me these two links on how to implement curl where the othter stuff doesn't work: http://php.net/manual/en/book.curl.php and http://www.php.net/manual/en/curl.examples-basic.php
And this piece of jibberish:
An alternative code for fopen() is:
Instead of:
$file = "http://somelocation.com/somefile.xml";
$fp = fopen($file, "r");
This code with curl:
$file = "http://somelocation.com/somefile.xml";
$ch = curl_init($file);
$fp = @fopen("temp.xml", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$file = "temp.xml";
$fp = fopen($file, "r");
It is imperative that you have write rights, so you can write curl in temp.xml
An alternative code for file_get_contents() is:
Local domain:
current:
require_once(file_get_contents('http://www.domein.nl/index.php");
alternative:
require_once("/home/gebruiker/domains/domein.nl/public_html/index.php");
Retrieving externally:
current:
$file_contents = file_get_contents('http://example.com/');
alternative:
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://example.com');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
Can you do something with this?
Davinia,
I am not sure about the security risk of that, but as I am not an expert on web hosting I will believe them - where I host my website do have it enabled and there are more, otherwise I would probably have a lot of comments about it not working ;)
Anyway, just found an email from a photopic user about using curl (almost had forgotten about it). Nabendu Saha had somehow solved it and sent me his version of the code so I can have a look at it. Fortunately I have kept the code.
I will send a replacement file 'photopic.module' which you could try to see if it works for you. Unfortunately I do not have a lot of time on my hands to test it myself, so apologies. However I will give you some exact instructions to be able to test it out. It is very safe as there are no changes to Drupal and does not read/write to the database.
All you need to do is replace the module file with the new one, try it out to see if it works. If not, just replace the old version back to get back to what you had before (with simplexml function).
If anyone who has a similar problem would like to try this experimental update, send me an email and I'll reply back with the file attached :)
Kevin
I don't really know all that much about hosting and what's save and what isn't. But I have no other option but to comply as it is a shared host.
Thanks for sending me the new photopic.module. I've replaced it with the original one and its working!! Pretty sweet :D
It shows all my public albums, and it works with the lightbox module flawlessly.
It's a perfect addition to my site, so thank you very much for the trouble. I will be using the donate button in jaruari (sorry, december is expensive)
Davinia,
It is great that it is working for you. Hopefully I will be able to do some more research on curl and implement it permanently into photopic.
I thank you in advance for any amount of donation. It does help to encourage me to try to find as much time as possible to work on photopic.
hehehe I agree December is expensive... just did my Xmas shopping last week.
Thank you and Happy Holidays!
Kevin
Happy holidays to you too :D
Is there any chance someone can send me, or make available somewhere, the modified photopic.module?
Hi Johnny,
Apologies for not replying immediately - was on a skiing holiday... internet on the mountains is not so reliable so could not reply ;)
Send me your email address by using the contact form on the contact me page and I will send you the photopic.module file so you can try it out.
Kevin
Can you please give me the same module which you have given to Davinia, Actually I am facing the same problem which davina has already faced.
Thnaks in advance.
Regards
Amit k Soni
http://amitksoni.com
Very goodAdjustable Hat post. MadeMLB Adjustable Hat me realize NFL Adjustable HatI was totallyNBA Adjustable Hat wrong Adjustable Hatabout this NFL Adjustable Hatissue. I figurehat club that one red hatlearns something hat storenew everyday. Mrs hat storeRight learnedMonster t-shirt her Monster Energy T-shirtlesson! Nice, informativeMonster Energy T-shirt website Fox shirtsby the way.
Hi Davinia,
Apologies for not replying very soon. Unfortunately work is getting the better of me :(
The error means that photopic is not able to connect to Google servers and load the xml.
One reason could be that your website host is blocking external access of xml from other sites.
Kevin