Results 1 to 5 of 5
-
30th Apr 2010, 08:46 AM #1OPMemberWebsite's:
Oxycot.in Oxycotn.in NulledHost.com UGNW.netcURL 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: 5Respected.
-
30th Apr 2010, 08:57 AM #2Member
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
-
30th Apr 2010, 01:17 PM #3The Wise OneWebsite's:
twilight.ws ddlrank.comTry moving curlopt_followlocation line between this:
PHP Code:if(ini_get('safe_mode')){
//Paste code here
}
I can always be contacted by sending a tweet @twilightws
-
30th Apr 2010, 01:52 PM #4MemberWebsite's:
litewarez.net litewarez.com triniwarez.comI 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 ($go, CURLOPT_URL, $url);
//follow on location problems
if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off'))
{
curl_setopt ($go, CURLOPT_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($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
list($header, $data) = explode("\n\n", $data, 2);
$http_code = curl_getinfo($ch, CURLINFO_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($ch, CURLINFO_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($ch, CURLOPT_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
-
2nd May 2010, 01:57 AM #5OPMemberWebsite's:
Oxycot.in Oxycotn.in NulledHost.com UGNW.netFixed, thanks mate.
Respected.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Help] PHP Curl Lumfile.com Problem
By heppinnz in forum Web Development AreaReplies: 4Last Post: 23rd Jun 2012, 02:21 PM -
PHP CURL Problem with Pixhost.org
By heppinnz in forum Web Development AreaReplies: 6Last Post: 20th Jun 2012, 05:10 PM -
[Help] PHP Curl Uploader to RapidShare Problem
By heppinnz in forum Web Development AreaReplies: 2Last Post: 29th Nov 2011, 06:28 AM -
curl problem
By cyberz in forum Technical Help Desk SupportReplies: 5Last Post: 6th Aug 2010, 09:05 PM -
Problem using CURL
By black0xio in forum Web Development AreaReplies: 10Last Post: 5th Aug 2010, 12:21 PM
themaLeecher - leech and manage...
Version 4.94 released. Open older version (or...