Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURLOPT_FOLLOWLOCATION & open_basedir #10

Open
Francois-Francois opened this issue Feb 11, 2014 · 14 comments
Open

CURLOPT_FOLLOWLOCATION & open_basedir #10

Francois-Francois opened this issue Feb 11, 2014 · 14 comments

Comments

@Francois-Francois
Copy link

Using < PHP5.4 and with open_basedir set I get the following error:

curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set

This is a Mailchimp library issue, but i would be happy to know how laravel-mailchimp users get around this issue.
For now, I've commented the bad line in mailchimp lib, but it's a quick fix.

On < PHP5.4, there is no safe_mode so you can't fill in this condition :

if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
  if (Z_LVAL_PP(zvalue) != 0) {
    php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set");
    RETVAL_FALSE;
    return 1;
  }
}
@hugofirth
Copy link
Owner

Hi @Rikless

To be honest I haven't encountered this issue myself and so have no sure fire way to cope with it.
This package could do with a little TLC though - so I'll try and make time to do a little work on the weekend, and see if I can't document a work around.

Apologies if that wasn't what you were hoping for :(

@wagmiwiz
Copy link

Hey, I have the same problem on PHP 5.4.10, just wondering if there is a workaround of any sort?

@kyrpas
Copy link

kyrpas commented Jun 12, 2014

Seems like using 2.0.4 mailchimp package instead fixes it. Add this to your composer.json:
"mailchimp/mailchimp": "2.0.4",

@hugofirth
Copy link
Owner

Hi @nikbora & @kyrpas

I see that the latest tagged release of the mailchimp/mailchimp package is 2.0.5. If reverting back solves your issue then by all means do it for now, but obviously this isn't ideal. If there really is a regression (2.0.5 re-introduced a bug which 2.0.4 fixed) then if you report the bug to mailchimp hopefully it will get fixed fairly promptly.

Cheers

@wagmiwiz
Copy link

That is right, mailchimp 2.0.5 seems to break in a different way as it
expects the $opts which initialise Mailchimp class to contain a flag for
"CURLOPT_FOLLOWLOCATION". Seems a little strange they didn't decide to
default to some value if not present - will check with them.

It causes an 'ErrorException' with message 'Undefined index:
CURLOPT_FOLLOWLOCATION'

On Thu, Jun 12, 2014 at 11:05 AM, Hugo Firth notifications@github.com
wrote:

Hi @nikbora https://github.com/nikbora & @kyrpas
https://github.com/kyrpas

I see that the latest tagged release of the mailchimp/mailchimp package is
2.0.5. If reverting back solves your issue then by all means do it for now,
but obviously this isn't ideal. If there really is a regression (2.0.5
re-introduced a bug which 2.0.4 fixed) then if you report the bug to
mailchimp hopefully it will get fixed fairly promptly.

Cheers


Reply to this email directly or view it on GitHub
#10 (comment)
.

@markovic131
Copy link

I have encountered the same issue.

"Undefined index: CURLOPT_FOLLOWLOCATION"

Will report to Mailchimp.

@n3rotech
Copy link

@psybaron do you fix this issue?
i get that error too and i dont know the solution.
anyone help me.

@wagmiwiz
Copy link

You can put mailchimp/mailchimp 2.0.3 as an extra package in composer.json
as a workaround.
On 13 Jun 2014 03:26, "n3rotech" notifications@github.com wrote:

@psybaron https://github.com/psybaron do you fix this issue?
i get that error too and i dont know the solution.
anyone help me.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@n3rotech
Copy link

thank you Brbora :D

On Thu, Jun 12, 2014 at 11:38 PM, Nik Brbora notifications@github.com
wrote:

You can put mailchimp/mailchimp 2.0.3 as an extra package in composer.json
as a workaround.
On 13 Jun 2014 03:26, "n3rotech" notifications@github.com wrote:

@psybaron https://github.com/psybaron do you fix this issue?
i get that error too and i dont know the solution.
anyone help me.


Reply to this email directly or view it on GitHub
<
https://github.com/hugofirth/laravel-mailchimp/issues/10#issuecomment-45969872>

.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@hugofirth
Copy link
Owner

@nikbora how in your usage does 2.0.3 throw up any other bugs? I'm considering tagging a bug fix release with the hard dependency on that earlier version, and then tagging another release reverting back to the way it is now when Mailchimp tag a release which includes a bug fix for this issue.

@wagmiwiz
Copy link

Hey Hugo, we have been running with mailchimp 2.0.3 with no issues or bugs.

On Wed, Jun 18, 2014 at 5:34 PM, Hugo Firth notifications@github.com
wrote:

@nikbora https://github.com/nikbora how in your usage does 2.0.3 throw
up any other bugs? I'm considering tagging a bug fix release with the hard
dependency on that earlier version, and then tagging another release
reverting back to the way it is now when Mailchimp tag a release which
includes a bug fix for this issue.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@markovic131
Copy link

@hugofirth I switched this morning to 2.0.3, and no issue as well. Though I only use the API to add new registrants to a list.

@hugofirth
Copy link
Owner

@nikbora & @psybaron Ok - I'll give it till the morning for some testing and for others to chime in, and then tag a release then. I appreciate the input.

@Francois-Francois
Copy link
Author

In 2.0.4 this bug was present, and in 2.0.5, it's still there.

In 2.0.4, to get a functional application, I commented this line in :
/vendor/mailchimp/mailchimp/src/Mailchimp.php

curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);

In 2.0.5, after a composer update, I had to comment in the same file :

if ($opts['CURLOPT_FOLLOWLOCATION'] === true) {
    curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
}

I've reported this issue since many times to mailchimp group, but even if code has change, issue isn't solved.
https://groups.google.com/forum/#!topic/mailchimp-api-discuss/u5Xo30XF9Sw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants