Well, it’s not my server, but a friends but from what i’ve read neither turning safe mode off nor making changes to open_basedir is recommended.
Is there any serious issues with setting CURLOPT_FOLLOWLOCATION to false? That at least solved the issue, but I’m not exactly sure what the other problems may arise if I do that.