I'm trying to get this cronjob to work but it won't exec the the ffmpeg exec that I have in my controller file.
When I try to run it via web browser it outputs the variables correctly but won't exec
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Cron extends CI_Controller {
public function transcode_wmv() {
$this->db->select('*');
$this->db->from('transcoding');
$this->db->where("status", 'ready');
$get_ready_file = $this->db->get();
$ready_file = $get_ready_file->result();
foreach($ready_file AS $RF)
{
$filename = $RF->newname;
$output= $RF->newname;
}
##exec("ffmpeg -y -i $filename -vcodec wmv2 -b 14000k -qmin 1 $output.wmv");
$command = "ffmpeg -y -i $filename -vcodec wmv2 -b 14000k -qmin 1 $output.wmv";
exec($command);
echo $command;
echo "<br>done";
}
}//end
If I try to open the url in chrome/firefox via www.example.com/cron/transcode_wmv I can see the contents and I can see the echo and it has the proper data so it is getting the right info from mysql but wont' exec the ffmpeg.
I've tried running it cli with curl but no luck I just get the output of $command and still doesn't exec ffmpeg.
I've also tried running
php /var/www/html/site/index.php cron transcode_wmv
But I get this error and still no exec on ffmpeg
PHP Notice: Undefined index: REQUEST_URI in /var/www/html/site/application/config/config.php on line 364
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: REQUEST_URI</p>
<p>Filename: config/config.php</p>
<p>Line Number: 364</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: REMOTE_ADDR</p>
<p>Filename: core/Input.php</p>
<p>Line Number: 351</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /var/www/html/site/system/core/Exceptions.php:185)</p>
<p>Filename: libraries/Session.php</p>
<p>Line Number: 688</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /var/www/html/site/system/core/Exceptions.php:185)</p>
<p>Filename: libraries/Session.php</p>
<p>Line Number: 688</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /var/www/html/site/system/core/Exceptions.php:185)</p>
<p>Filename: helpers/url_helper.php</p>
<p>Line Number: 542</p>
Any ideas? Driving me nuts!
Also running current version of CI
TIA