We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Error, Addons, Field-Types

Vimeo Field Types curl error

I get the following error using the Vimeo field type. (The site is on Mediatemple Grid server.

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php on line 194

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php:194) in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/core/inc/top.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php:194) in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/core/inc/top.php on line 14

Any idea why I get these error messages? Everything seems to work, and outputs correctly.

The site is on Mediatemple grid, and has SSL certificate (https)

Dan Andersen

Dan Andersen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You should turn off Safe Mode. It's deprecated and a bad idea. Might be better still to update to a modern version of PHP.

I've updated the PHP to: PHP 5.5.18

And then I got this instead:

Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php on line 194

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php:194) in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/core/inc/top.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/addons/fieldtypes/vimeo/vimeo.class.php:194) in /nfs/c04/h02/mnt/66163/domains/domain.com/html/enkel/core/inc/top.php on line 14

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. The issue there is pretty much as it says. You have open_basedir set, and that is incompatible with the CURLOPT_FOLLOWLOCATION curl option.

I don't have a solution to that.

I don't really know what open_basedir and CURLOPT_FOLLOWLOCATION is.

But would it help if i set a path for open_basedir in the php.ini file? Or can it be turned off?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Turning it off should do the trick.

Ok, any idea how to turn it off? it's not mentioned in the php.ini file?

Drew McLellan

Drew McLellan 2638 points
Perch Support

open_basedir does appear in your php.ini at all?

Nope, no mention of it at all.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You might need to ask your host, then.

If your on (mt) Media Temple, you won't be able to turn open_basedir off. So Vimeo field type won't work for anyone on (mt) server.

Maybe there's a workaround, I'm trying to grab the id from a vimeo video to use in a jquery lightbox. And i wanted to use the <perch:content id="video" type="vimeo" output="id" />

Is there any way in perch to removed a (predefined) part of a text input, i.e. remove https://vimeo.com/ from https://vimeo.com/116981030 so I'm left with just the id number?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It would probably be simplest to remove the CURLOPT_FOLLOWLOCATION from the field type.

Ok, how do I remove it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's on line 194 or thereabouts:

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

comment it out:

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

Thanks Drew! It works now without the warning (error message)

I experienced the same problem on Media Temple GRID.

I commented out line 194 as described above, removes the error messages.

  • I'm curious what does line 194 do?
  • How come it's ok to comment it out? :)

It's worth mentioning, this isn't a problem on Media Temple VPS servers.