Activity Stream
48,167 MEMBERS
6876 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member
    Website's:
    Oxycot.in Oxycotn.in NulledHost.com UGNW.net

    Lightbulb cURL or PHP Problem.

    Hey,
    Restoring some forums tonight and after i bigdump the sql, and rebuild the language, i get this error while trying to post or see any old thread...

    " CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir "

    and then a big list of errors, from trying to shorten down the urls, or into bitly..vb2twitter mod..werid?
    I checked to see, but open_basedir = is blank and php safe_mode is off..?
    I have checked and see I have to do a bypass or something maybe >< cmon, help me im stoned.
    deelow66 Reviewed by deelow66 on . cURL or PHP Problem. Hey, Restoring some forums tonight and after i bigdump the sql, and rebuild the language, i get this error while trying to post or see any old thread... " CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir " and then a big list of errors, from trying to shorten down the urls, or into bitly..vb2twitter mod..werid? I checked to see, but open_basedir = is blank and php safe_mode is off..? I have checked and see I have to do a bypass or something maybe >< Rating: 5
    Respected.

  2.   Sponsored Links

  3.     
    #2
    Member
    I would remove the mod using curl when posting... sounds strange

    enable open_basedir and leave it like that for security.

    you may be able to remove the line CURLOPT_FOLLOWLOCATION if you really want the mod that uses curl

  4.     
    #3
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    Try moving curlopt_followlocation line between this:

    PHP Code: 
    if(ini_get('safe_mode')){
        
    //Paste code here

    This isn't a solution but it safer code to execute. I used to have the problem with a crawler I ran on another server.
    I can always be contacted by sending a tweet @twilightws

  5.     
    #4
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    I had this problem a long time back and its due to the fact that curl is only a php module and not part of the php core, therefore it doesn't know values of base_dir etc etc

    there's 1 possible workaround for you to use without compromising your safe_mode setting

    Please check
    http://au.php.net/manual/ro/function...topt.php#71313

    heres an example usage for you

    PHP Code: 
    function curl($url)
    {
        
    $go curl_init($url);
        
    curl_setopt ($goCURLOPT_URL$url);
        
    //follow on location problems

        
    if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off'))
        {
            
    curl_setopt ($goCURLOPT_FOLLOWLOCATION$l);
            
    $syn curl_exec($go);
        }else
        {
            
    $syn curl_redir_exec($go);
        }
        
    curl_close($go);
        return 
    $syn;
    }
    *
    function 
    curl_redir_exec($ch)
    {
        static 
    $curl_loops 0;
        static 
    $curl_max_loops 20;
        if (
    $curl_loops++>= $curl_max_loops)
        {
            
    $curl_loops 0;
            return 
    FALSE;
        }
        
    curl_setopt($chCURLOPT_HEADERtrue);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    $data curl_exec($ch);
        list(
    $header$data) = explode("\n\n"$data2);
        
    $http_code curl_getinfo($chCURLINFO_HTTP_CODE);
        if (
    $http_code == 301 || $http_code == 302)
        {
            
    $matches = array();
            
    preg_match('/Location:(.*?)\n/'$header$matches);
            
    $url = @parse_url(trim(array_pop($matches)));
            if(!
    $url)
            {
                
    //couldn't process the url to redirect to
                
    $curl_loops 0;
                return 
    $data;
            }
            
    $last_url parse_url(curl_getinfo($chCURLINFO_EFFECTIVE_URL));
            if(!
    $url['scheme']){
                
    $url['scheme'] = $last_url['scheme'];
            }
            if(!
    $url['host'])
            {
                
    $url['host'] = $last_url['host'];
            }
            if(!
    $url['path'])
            {
                
    $url['path'] = $last_url['path'];
            }
            
    $new_url $url['scheme'] . '://' $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:'');
            
    curl_setopt($chCURLOPT_URL$new_url);
            return 
    curl_redir_exec($ch);
        }else
        {
            
    $curl_loops=0;
            return 
    $data;
        }

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  6.     
    #5
    Member
    Website's:
    Oxycot.in Oxycotn.in NulledHost.com UGNW.net
    Fixed, thanks mate.
    Respected.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Help] PHP Curl Lumfile.com Problem
    By heppinnz in forum Web Development Area
    Replies: 4
    Last Post: 23rd Jun 2012, 02:21 PM
  2. PHP CURL Problem with Pixhost.org
    By heppinnz in forum Web Development Area
    Replies: 6
    Last Post: 20th Jun 2012, 05:10 PM
  3. [Help] PHP Curl Uploader to RapidShare Problem
    By heppinnz in forum Web Development Area
    Replies: 2
    Last Post: 29th Nov 2011, 06:28 AM
  4. curl problem
    By cyberz in forum Technical Help Desk Support
    Replies: 5
    Last Post: 6th Aug 2010, 09:05 PM
  5. Problem using CURL
    By black0xio in forum Web Development Area
    Replies: 10
    Last Post: 5th Aug 2010, 12:21 PM

Tags for this Thread

BE SOCIAL