Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 02:47:33 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: allow_url_fopen disabled on server  (Read 1770 times)
finetoons

Offline Offline

Posts: 3


« on: December 18, 2007, 12:28:22 PM »

My lovely host, unannounced, globally disabled "allow_url_fopen" in the default.php.ini files.

There is no way to override this change.

So I think I have to adjust WB to use another means of remote file access.  They recommend using cURL.

I'm not a programmer...will this cause problems?



Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6819


WWW
« Reply #1 on: December 19, 2007, 04:30:56 AM »

I haven't yet found any issues using cURL on hosts where allow_url_fopen is disabled. Here is some sample Code from a Template I created

Code:
       <?php
                 ob_start
();
                     
page_content(2);
                     
$quote ob_get_contents();
                 
ob_end_clean();

                 if (
$quote ==""){
                      
$ch curl_init();
                            
$timeout 5// set to zero for no timeout
                            
curl_setopt ($chCURLOPT_URLWB_URL.'/pages/global.php');
                            
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
                            
curl_setopt ($chCURLOPT_CONNECTTIMEOUT$timeout);
                            
$file_contents curl_exec($ch);
                            
curl_close($ch);
                            
// display file
                            
echo $file_contents;
                 } else {
                      echo 
$quote;
                 };
            
?>


This code is for a global block which is displayed if the 2nd section of the page is empty.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

finetoons

Offline Offline

Posts: 3


« Reply #2 on: December 19, 2007, 08:44:13 PM »

Great! Thank  you.  Do you know where I would even begin to look (which file) for where allow_url_fopen is in the WB code?
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6819


WWW
« Reply #3 on: December 20, 2007, 06:13:26 PM »

WebsiteBaker itself doesn't use the include function (as far as I remember). But it might be used in single modules or even templates (I do if I can ...).

So, if you are having issues with it, try a different templates or check which module you are using at the moment when you get the error.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!