Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

YouTube Error

Go to End

4 Posts   1372 Views


Community Member, 121 Posts

11 February 2010 at 5:32pm

When I tried installing the YouTube module, it seemed to have installed properly and so I created the page in the admin panel. When I tried to visit it on the live site, I get this error:

[Warning] curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

GET /bigvote/videos/

Line 104 in /sapphire/api/RestfulService.php


96 		} else {
97 			$ch = curl_init();
98 			$timeout = 5;
99 			$useragent = "SilverStripe/2.2";
100 			curl_setopt($ch, CURLOPT_URL, $url);
101 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
102 			curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
103 			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
104 			curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
105 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
107 			// Add headers
108 			if($this->customHeaders) {
109 				$headers = array_merge((array)$this->customHeaders, (array)$headers);
110 			}

Anyone has an idea why this is so?


Community Member, 323 Posts

11 February 2010 at 11:17pm


The error says your server’s security settings doesn’t allow CURLOPT_FOLLOWLOCATION. I think it’s often the case in shared hosts.

Change line 104 to:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);

Hope it helps,


Community Member, 121 Posts

12 February 2010 at 2:35am

Thanks! that did the trick!

Although, does the YouTube module really work this way? When I click the video, it just opens a link that will take me to the video which will occupy the whole video. For me, it just seems kinda weird... or is it just me? Is there a possible way that it will open up a lightbox like window/media player where the video can be played in normal size? Or can it open a new page which will take me to the video which will have a description or comment box?

Here is the youtube service module implementation btw:


Community Member, 323 Posts

12 February 2010 at 5:28am

Edited: 12/02/2010 6:19am

No, that’s not the expected behaviour. You should get something as:

This site (dead for the moment) was done a year ago, so I don’t remember the changes I had to do in order to make Youtube videos work. Please search the forum as I think there was other problems related to shared host environments and JScript issues as well. If I find some time later I’ll try to look myself.