CodeIgniter Forums

Full Version: Local/Live Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
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';

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.
(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 ...
(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
You could prove exec function enabled:

Code:
echo exec('ls');

If truly enabled, I don't know why you are having problems. Sorry.
(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
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.
(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
How did you upload ffmpeg file? If you just ftp'ed you have to change permissions on it to allow executing.
Pages: 1 2