Welcome Guest, Not a member yet? Register   Sign In
CRON JOB: is_cli_request returns false instead of true
#1

[eluser]bogdan3l[/eluser]
Code:
<?php

class Cron extends CI_Controller
{
    public function clean()
    {
        if ($this->input->is_cli_request())
        {
            // do something
        }
        else
        {
            redirect('/');
        }
    }
}

/usr/local/bin/php /home/username/public_html/index.php cron clean

Any suggestions? Thank you!
#2

[eluser]bogdan3l[/eluser]
Quote:Many well tuned large Linux servers, run cron jobs in cgi mode, not cli, for greater CPU efficiency, lower memory use, and better PHP opcode caching.

Any workarounds? No one?
#3

[eluser]bogdan3l[/eluser]
Changed:

Code:
$config['uri_protocol'] = 'REQUEST_URI';

To

Code:
$config['uri_protocol'] = 'AUTO';

And everything works great!




Theme © iAndrew 2016 - Forum software by © MyBB