Jump to:

10930 Posts in 2613 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » YouTube Error

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1067 Views
  • animasola
    Avatar
    Community Member
    121 Posts

    YouTube Error Link to this post

    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

    SOURCE:

    95          
    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);
    106       
    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?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: YouTube Error Link to this post

    Hi!

    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,
    Juan

  • animasola
    Avatar
    Community Member
    121 Posts

    Re: YouTube Error Link to this post

    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:

    http://right2vote.net/bigvote/media

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: YouTube Error Link to this post

    No, that’s not the expected behaviour. You should get something as: http://connect-pd.eu/videos-en/

    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.

    Regards,
    Juan

    1067 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.