cloudkey-php icon indicating copy to clipboard operation
cloudkey-php copied to clipboard

CURLOPT_FOLLOWLOCATION problem

Open yoyoy opened this issue 12 years ago • 12 comments

Bonjour, j'essaye d'utiliser ce code $res = $dm->media->info(array('id' => $video->dmId, 'fields' => array('id','meta.title', 'embed_url','frame_ratio','assets.jpeg_thumbnail_source.stream_url','assets.jpeg_thumbnail_small.stream_url','assets.jpeg_thumbnail_medium.stream_url','assets.jpeg_thumbnail_large.stream_url','assets.source.duration', 'created', 'meta.title' ) ));

en local tout est OK mais une fois en ligne j'ai ce message

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/xxx.com/xxxx/includes/dmcloud/CloudKey.php on line 229

que puis-je faire ? merci


hello, I use this code $res = $dm->media->info(array('id' => $video->dmId, 'fields' => array('id','meta.title', 'embed_url','frame_ratio','assets.jpeg_thumbnail_source.stream_url','assets.jpeg_thumbnail_small.stream_url','assets.jpeg_thumbnail_medium.stream_url','assets.jpeg_thumbnail_large.stream_url','assets.source.duration', 'created', 'meta.title' ) ));

when i work on localhost all si right but online this is an error message

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/xxx.com/xxxx/includes/dmcloud/CloudKey.php on line 229

what can i do ? thanks

yoyoy avatar Mar 15 '12 17:03 yoyoy

Is it possible for you to disable PHP safe mode? Safe mode is deprecated since PHP 5.3.

rs avatar Mar 15 '12 17:03 rs

I think... but I'm not sure for the security of my applications without this security option activated ... could I modify the CloudKey Class whith false for this parameter ? does it works anyway ?

yoyoy avatar Mar 16 '12 16:03 yoyoy

I have this param with phpinfo

safe_mode Off (local value) On(master value)

but it look's not on OFF in local :(

yoyoy avatar Mar 16 '12 16:03 yoyoy

Safe mode doesn't really add safety to your app. You may put the option to false for API calls (as we do not return redirects) but you can't for video stream requests.

rs avatar Mar 16 '12 16:03 rs

i've turned off my safe mode but the problem persists

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/xxxx.com/xxxxx/includes/dmcloud/CloudKey.php on line 229

php info safe_mode Off Off

any idea ?

yoyoy avatar Mar 16 '12 17:03 yoyoy

is it a right way to disable that just in some cases (without modify the original api class?)

for example for this code

$res = $dm->media->info(array('id' => $video->dmId, 'fields' => array('id','meta.title', 'embed_url','frame_ratio','assets.jpeg_thumbnail_source.stream_url','assets.jpeg_thumbnail_small.stream_url','assets.jpeg_thumbnail_medium.stream_url','assets.jpeg_thumbnail_large.stream_url','assets.source.duration', 'created', 'meta.title') ));

yoyoy avatar Mar 16 '12 17:03 yoyoy

No you'll have to edit the code.

rs avatar Mar 16 '12 17:03 rs

ok, but how can I set this param in my code ? thanks

note : it is a warning but the code is correctly executed ... don't understand

yoyoy avatar Mar 16 '12 17:03 yoyoy

Remove CURLOPT_FOLLOWLOCATION from the curlopt_array

rs avatar Mar 16 '12 17:03 rs

ah no...sorry ... when i want to upload a file or create a media it does not works

$res = $dm->file->upload_file($realdir.$fichier);

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/xxxxx.com/xxxxx/includes/dmcloud/CloudKey.php on line 229 Warning: curl_setopt_array():

:( :( :(

yoyoy avatar Mar 16 '12 17:03 yoyoy

hmmm ... i have an open_basedir in my phpinfo ...

open_basedir /var/www/vhosts/xxxx.com/xxxxx/:/tmp/ no value

must I change that ? I'm not realy happy to this idea :(

yoyoy avatar Mar 16 '12 17:03 yoyoy

by Removing CURLOPT_FOLLOWLOCATION from the curlopt_array in cloudKey.php it works but i hope it will continue to work whene you update the system from your side ...

if you have a best solution, I take :)

thanks a lot

yoyoy avatar Mar 16 '12 18:03 yoyoy