cloudkey-php
cloudkey-php copied to clipboard
CURLOPT_FOLLOWLOCATION problem
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
Is it possible for you to disable PHP safe mode? Safe mode is deprecated since PHP 5.3.
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 ?
I have this param with phpinfo
safe_mode Off (local value) On(master value)
but it look's not on OFF in local :(
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.
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 ?
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') ));
No you'll have to edit the code.
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
Remove CURLOPT_FOLLOWLOCATION from the curlopt_array
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():
:( :( :(
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 :(
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