Search…

X3 Photo Gallery Support Forums

Search…
 
pleibling
Experienced
Topic Author
Posts: 45
Joined: 02 Jan 2017, 09:59

Problems Create Siteobjects

03 Nov 2018, 13:34

Hello,

i move my Gallery on my Homeserver. The Server is Windows 2012 R2 with IIS and activated PHP. The Page works, but when i want to use the Preload Feature i get the Error:

Your Server does not allow curl or file_gets_content for curl

phpinfo show me, that curl is activated (take a look at the Screenshot).

Can anybody help me to solve the problem?

Thanks a lot for your help.
Attachments
Curl.PNG
Curl.PNG (74.66 KiB) Viewed 1811 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Problems Create Siteobjects

04 Nov 2018, 01:35

Just because it's installed, doesn't necessarily mean it works ... Or it could be Windows-related and possibly X3 not rendering the PATH correctly from Windows. The below is the code, and it's failing ... Either your server does not allow curl or file_get_contents for security reasons, or the $path is corrupted from Windows. I don't normally recommend Windows, but if you got it working, ok. I would need FTP if I am to diagnose.
Code
if(function_exists('curl_version')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $path);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
$site = curl_exec($ch);
curl_close($ch);
} else {
$site = @file_get_contents($path);
}

if($site === false) {
echo '{ "error": "Your server does not allow curl or file_get_contents for Url." }';
You don't really need to use "site preload" any more. Since X3.25, there was already a new feature "preload website auto cache" which does the same, although the cache is populated progressively. So any one visitor would need to view the pages before they get cached the same way as "site preloade". Read about in below link, scroll down to "Preload Website Auto Cache ".
https://www.photo.gallery/blog/photo-gallery-X3-25/

I think In will be improving the site preloader tool soon.