I am running on a shared Plesk server running PHP5.2.6 (safe-mode off), and getting a warning:

warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/.../httpdocs/sites/all/modules/feedapi/parser_common_syndication/parser_common_syndication.module on line 177.

Tracked it down to a change that was added in PHP5.2.0 (http://www.php.net/ChangeLog-5.php#5.2.0):

Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are enabled. (Stefan E., Ilia)

CommentFileSizeAuthor
#9 phpinfo.htm_.txt12.55 KBicecreamyou

Comments

peter.walter’s picture

Change was also added to PHP5.1.5 (http://www.php.net/ChangeLog-5.php#5.1.5)

aron novak’s picture

As a workaround i suggest you to disable cURL support. You can do that by editing parser_common_syndication.module, line 145 and instead of :
$curl = function_exists('curl_init');
replace it to:
$curl = FALSE;

tingtong’s picture

Version: 6.x-1.4 » 6.x-1.5
Component: Code » Code feedapi (core module)

I set according to your suggestion and the warning error disappear. What is the disadvantage of setting it "FALSE"? I have no idea what is it.

aron novak’s picture

Status: Active » Fixed

I committed a fix. In safe mode, common syndication parser uses drupal_http_request.

niklp’s picture

YAY! And here was me making a note of the hack :)

Thanks Aron, nice one!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

niklp’s picture

Status: Closed (fixed) » Active

I still get this bug even with feedapi 1.x from today :(

Is there a check in place for safemode now - and if so, does that mean it's open_basedir that's causing this to bork on my setup?

Doesn't the check work for both...? :/

I'm a little confused.

aron novak’s picture

Status: Active » Postponed (maintainer needs more info)

Can you attach the content of 'admin/reports/status/php' ?

icecreamyou’s picture

StatusFileSize
new12.55 KB

I have the same error. safe_mode is off. PHP 5.2.8, MySQL 5.0.

icecreamyou’s picture

Version: 6.x-1.5 » 6.x-1.6
Component: Code feedapi (core module) » Code parser_common
virtualdrupal’s picture

I'm having the same issue trying both the 6.x-1.6 and the dev right now


    * warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/nonficti/public_html/sites/all/modules/feedapi/parser_common_syndication/parser_common_syndication.module on line 182.
    * warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/nonficti/public_html/sites/all/modules/feedapi/parser_common_syndication/parser_common_syndication.module on line 182.

j4’s picture

I am also getting the same problem :-(. Is there a fix?

Thank you

aron novak’s picture

Status: Postponed (maintainer needs more info) » Fixed

Today i committed a fix. The next daily dev package will contain it. Please test it if it helps.

icecreamyou’s picture

Seems to have worked for me. Thanks.

j4’s picture

Sorry to appear dumb, but where do i find the version with the fix. Also i see that pormanscron should not be switched on with feedapi. Any explanations for what happens if both are on. Thanks for looking into this.

Warm regards
Jaya

aron novak’s picture

1) http://ftp.drupal.org/files/projects/feedapi-6.x-1.x-dev.tar.gz
2) Poormanscron does not follow the way how Drupal normal cron run works. This is the problem: http://drupal.org/node/119094

j4’s picture

Hi Thank you. Did download and use the new feedapi. Now the items are pulled in but I am still getting the warning
warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/idein7/public_html/thebrandyou.com/modules/feedapi/parser_common_syndication/parser_common_syndication.module on line 177.
And the feed items are not visible in the feed page but are visible when i go to admin/content. Could you please tell me where i am going wrong?

Thanks once again
Jaya

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupallogic’s picture

I also get this error. strange thing is some of my Drupal sites are giving this error some not. they are all under the same account though. really strange. hope someone fixes this.