candy-chat / xmpp-prebind-php

PHP class for creating a session on server side to an XMPP server
MIT License
63 stars 43 forks source link

cURL follow on location functionality and open_basedir or safe mode error #3

Closed ghost closed 9 years ago

ghost commented 12 years ago

cURLfollow on location functionality needs cannot be activated when safe_mode is enabled or an open_basedir is set, else the Kohana framework throws this error:

ErrorException [ Warning ]: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set

There is a workaround in XmppPrebind.php:

// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) { curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); }