When using this module in combination with a hoster that has safe_mode or open_basedir enabled things break apart.
Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in curl_http_request() (regel 204 van /var/www/gemeentemuseum-test/htdocs/sites/all/modules/contrib/chr/chr.module).
Using safe_mode is deprecated but the same can't be said for open_basedir. I run a couple of servers and i need this setting enabled for security reasons. Also a lot of shared hosting accounts will have this setting enabled.
as stated in http://drupal.org/node/1481634 there are a couple of sollutions:
- http://php.net/manual/en/function.curl-setopt.php#102121
- http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode
for now, when i disable the following line it all seems to work just as well.
CURLOPT_FOLLOWLOCATION => TRUE,
Comments
Comment #1
lolandese commentedIn the file chr.module
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);to:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);Comment #2
karol haltenberger commentedShould I expect something to break if the option is disabled?
Comment #3
minoroffense commentedLooks like any 3xx request would now fail.
http://curl.haxx.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html
In that case I would lean towards making this a toggled option rather than have it toggled to one or the other value.
The function _chr_curl_set_defaults() could load some variable settings instead.
Comment #4
giupenni commentedSame problem.
Fixed with #1