CodeIgniter Forums
Local/Live Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Local/Live Problem (/thread-64377.html)

Pages: 1 2


Local/Live Problem - Chandini - 02-14-2016

This is My local Code is Working fine In Local 

PHP Code:
$ffmpeg    "C:/ffmpeg/bin/ffmpeg";
$videoFiles "http://www.fdm.co.in/wannahelp/assets/chat_posts/sample.mp4";
$imageFile "video_thumb/12.jpg";
$size "120x90";
$getFromSecond 5;
$cmd "$ffmpeg -i $videoFiles -an -ss $getFromSecond -s $size $imageFile";
if (!
exec($cmd))
{
echo 
"thumb created"
}
else
{
echo 
"error getting";

This is My Server File In CI : 
PHP Code:
$ffmpeg FCPATH.'assets/ffmpeg/bin/ffmpeg';
 
      $videoFiles FCPATH.'assets/chat_posts/sample.mp4';
 
      $imageFile "public_html/wannahelp/assets/chat_posts/siva.jpg";
 
      $size "120X90";
 
      $getFromSecond 5;
 
      $cmd "$ffmpeg -i $videoFiles -an -ss $getFromSecond -s $size $imageFile";
//echo ini_get("disable_functions");
 
      //exec($cmd);
 
      if(!exec($cmd))
 
      {
 
      $s "created";
 
      }else
 
      {
 
      $s "Not created";
 
      
Out put Getting Same In Local and Live But video Thumbanail Is Not created in live .... In localhost Thumbnail Is created & working Fine .. Help Me


RE: Local/Live Problem - skunkbad - 02-15-2016

What happens if you run this:

PHP Code:
$ffmpeg        FCPATH 'assets/ffmpeg/bin/ffmpeg';
$videoFiles    FCPATH 'assets/chat_posts/sample.mp4';
$imageFile     "public_html/wannahelp/assets/chat_posts/siva.jpg";
$size          "120X90";
$getFromSecond 5;

$disabled_funcs explode','ini_get('disable_functions') );
if( ! 
in_array'exec'$disabled_funcs ) )
{
    try{
        $cmd "$ffmpeg -i $videoFiles -an -ss $getFromSecond -s $size $imageFile";

        exec$cmd$output$return_var );

        var_dump$output );

        var_dump$return_var );
    }
    catchException $e ){
        $s 'caught exception: ' $e->getMessage();
    }
}
else
{
    $s 'exec not available: not created';




RE: Local/Live Problem - Diederik - 02-15-2016

The exec() function falls into the same category as the shell_exec() (and passthru(),system() are all very similar) functions where you asked about a few days ago. Those functions should to be disabled for security reasons in a shared hosting environment.

Long story short, if you need/want such a function you would have to reach into your pockets and get a VPS which so you have full controll over all the server settigns and enable such a function in the servers php.ini file.


RE: Local/Live Problem - Chandini - 02-15-2016

(02-15-2016, 12:17 AM)skunkbad Wrote: What happens if you run this:

PHP Code:
$ffmpeg        FCPATH 'assets/ffmpeg/bin/ffmpeg';
$videoFiles    FCPATH 'assets/chat_posts/sample.mp4';
$imageFile     "public_html/wannahelp/assets/chat_posts/siva.jpg";
$size          "120X90";
$getFromSecond 5;

$disabled_funcs explode','ini_get('disable_functions') );
if( ! 
in_array'exec'$disabled_funcs ) )
{
    try{
        $cmd "$ffmpeg -i $videoFiles -an -ss $getFromSecond -s $size $imageFile";

        exec$cmd$output$return_var );

        var_dump$output );

        var_dump$return_var );
    }
    catchException $e ){
        $s 'caught exception: ' $e->getMessage();
    }
}
else
{
    $s 'exec not available: not created';

Output :
array(0) {
}
int(127).
I am Getting Empty Result(Thumbmail Not Created) .. . exec Function Is Enabled In My Server ...


RE: Local/Live Problem - Chandini - 02-15-2016

(02-15-2016, 01:04 AM)Diederik Wrote: The exec() function falls into the same category as the shell_exec() (and passthru(),system() are all very similar) functions where you asked about a few days ago. Those functions should to be disabled for security reasons in a shared hosting environment.

Long story short, if you need/want such a function you would have to reach into your pockets and get a VPS which so you have full controll over all the server settigns and enable such a function in the servers php.ini file.

exec function is enabled in my server


RE: Local/Live Problem - skunkbad - 02-15-2016

You could prove exec function enabled:

Code:
echo exec('ls');

If truly enabled, I don't know why you are having problems. Sorry.


RE: Local/Live Problem - Chandini - 02-15-2016

(02-15-2016, 09:12 AM)skunkbad Wrote: You could prove exec function enabled:

Code:
echo exec('ls');

If truly enabled, I don't know why you are having problems. Sorry.

I am Getting This Output
thumbcreation


RE: Local/Live Problem - skunkbad - 02-16-2016

So, maybe the exec user does not have permissions that are adequate for creating images in the target directory. Try to run this:

Code:
echo exec('whoami');

This will let you know the user and then compare that user to the directory permissions where the image is to be created. That's all I can think would be holding you back.


RE: Local/Live Problem - Chandini - 02-16-2016

(02-16-2016, 12:19 AM)skunkbad Wrote: So, maybe the exec user does not have permissions that are adequate for creating images in the target directory. Try to run this:

Code:
echo exec('whoami');

This will let you know the user and then compare that user to the directory permissions where the image is to be created. That's all I can think would be holding you back.

I am getting My domain name : fdm


RE: Local/Live Problem - siburny - 02-16-2016

How did you upload ffmpeg file? If you just ftp'ed you have to change permissions on it to allow executing.