Cron job in cakephp3 : error log fileCron job in cakephp3 : error log file

I am trying to run a cron with cakephp3 shell.I found The cron is not working and when i opend the error log file i got the following error.
In my log file I got this :

X-Powered-By: PHP/5.6.24
Content-type: text/html; charset=UTF-8

<pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr57da84598661d-trace').style.display = (document.getElementById('cakeErr57da84598661d-trace').style.display == 'none' ? '' : 'none');"><b>Notice</b> (8)</a>: Undefined variable: argv [<b>ROOT/bin/cake.php</b>, line <b>32</b>]<div id="cakeErr57da84598661d-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr57da84598661d-code').style.display = (document.getElementById('cakeErr57da84598661d-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr57da84598661d-context').style.display = (document.getElementById('cakeErr57da84598661d-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr57da84598661d-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"></span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"></span><span style="color: #007700">include&nbsp;</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__DIR__</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">'/config/bootstrap.php'</span><span style="color: #007700">;</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"></span></span></code></pre><pre id="cakeErr57da84598661d-context" class="cake-context" style="display: none;">$_GET = [
	&#039;/home/birelqar/public_html/election/bin/cake_php&#039; =&gt; &#039;&#039;,
	&#039;User&#039; =&gt; &#039;&#039;
]
$_POST = []
$_COOKIE = []
$_FILES = []
$_SERVER = [
	&#039;SHELL&#039; =&gt; &#039;/bin/bash&#039;,
	&#039;USER&#039; =&gt; &#039;birelqar&#039;,
	&#039;PATH&#039; =&gt; &#039;/usr/bin:/bin&#039;,
	&#039;PWD&#039; =&gt; &#039;/home/birelqar/public_html/election&#039;,
	&#039;LANG&#039; =&gt; &#039;en_US.UTF-8&#039;,
	&#039;HOME&#039; =&gt; &#039;/home/birelqar&#039;,
	&#039;SHLVL&#039; =&gt; &#039;1&#039;,
	&#039;LOGNAME&#039; =&gt; &#039;birelqar&#039;,
	&#039;PHP_SELF&#039; =&gt; &#039;&#039;,
	&#039;REQUEST_TIME_FLOAT&#039; =&gt; (float) 1473938521.4958,
	&#039;REQUEST_TIME&#039; =&gt; (int) 1473938521
]
$_REQUEST = [
	&#039;/home/birelqar/public_html/election/bin/cake_php&#039; =&gt; &#039;&#039;,
	&#039;User&#039; =&gt; &#039;&#039;
]
$_ENV = [
	&#039;SHELL&#039; =&gt; &#039;/bin/bash&#039;,
	&#039;USER&#039; =&gt; &#039;birelqar&#039;,
	&#039;PATH&#039; =&gt; &#039;/usr/bin:/bin&#039;,
	&#039;PWD&#039; =&gt; &#039;/home/birelqar/public_html/election&#039;,
	&#039;LANG&#039; =&gt; &#039;en_US.UTF-8&#039;,
	&#039;HOME&#039; =&gt; &#039;/home/birelqar&#039;,
	&#039;SHLVL&#039; =&gt; &#039;1&#039;,
	&#039;LOGNAME&#039; =&gt; &#039;birelqar&#039;
]
$GLOBALS = [
	&#039;_GET&#039; =&gt; [
		&#039;/home/birelqar/public_html/election/bin/cake_php&#039; =&gt; &#039;&#039;,
		&#039;User&#039; =&gt; &#039;&#039;
	],
	&#039;_POST&#039; =&gt; [],
	&#039;_COOKIE&#039; =&gt; [],
	&#039;_FILES&#039; =&gt; [],
	&#039;_SERVER&#039; =&gt; [
		&#039;SHELL&#039; =&gt; &#039;/bin/bash&#039;,
		&#039;USER&#039; =&gt; &#039;birelqar&#039;,
		&#039;PATH&#039; =&gt; &#039;/usr/bin:/bin&#039;,
		&#039;PWD&#039; =&gt; &#039;/home/birelqar/public_html/election&#039;,
		&#039;LANG&#039; =&gt; &#039;en_US.UTF-8&#039;,
		&#039;HOME&#039; =&gt; &#039;/home/birelqar&#039;,
		&#039;SHLVL&#039; =&gt; &#039;1&#039;,
		&#039;LOGNAME&#039; =&gt; &#039;birelqar&#039;,
		&#039;PHP_SELF&#039; =&gt; &#039;&#039;,
		&#039;REQUEST_TIME_FLOAT&#039; =&gt; (float) 1473938521.4958,
		&#039;REQUEST_TIME&#039; =&gt; (int) 1473938521
	],
	&#039;_REQUEST&#039; =&gt; [
		&#039;/home/birelqar/public_html/election/bin/cake_php&#039; =&gt; &#039;&#039;,
		&#039;User&#039; =&gt; &#039;&#039;
	],
	&#039;_ENV&#039; =&gt; [
		&#039;SHELL&#039; =&gt; &#039;/bin/bash&#039;,
		&#039;USER&#039; =&gt; &#039;birelqar&#039;,
		&#039;PATH&#039; =&gt; &#039;/usr/bin:/bin&#039;,
		&#039;PWD&#039; =&gt; &#039;/home/birelqar/public_html/election&#039;,
		&#039;LANG&#039; =&gt; &#039;en_US.UTF-8&#039;,
		&#039;HOME&#039; =&gt; &#039;/home/birelqar&#039;,
		&#039;SHLVL&#039; =&gt; &#039;1&#039;,
		&#039;LOGNAME&#039; =&gt; &#039;birelqar&#039;
	],
	&#039;GLOBALS&#039; =&gt; [recursion],
	&#039;minVersion&#039; =&gt; &#039;5.5.9&#039;,
	&#039;__composer_autoload_files&#039; =&gt; [
		&#039;0e6d7bf4a5811bfa5cf40c5ccd6fae6a&#039; =&gt; true,
		&#039;34122c0574b76bf21c9a8db62b5b9cf3&#039; =&gt; true,
		&#039;c720f792236cd163ece8049879166850&#039; =&gt; true,
		&#039;ede59e3a405fb689cd1cebb7bb1db3fb&#039; =&gt; true,
		&#039;90236b492da7ca2983a2ad6e33e4152e&#039; =&gt; true,
		&#039;b1fc73705e1bec51cd2b20a32cf1c60a&#039; =&gt; true,
		&#039;667aeda72477189d0494fecd327c3641&#039; =&gt; true,
		&#039;e7223560d890eab89cda23685e711e2c&#039; =&gt; true
	],
	&#039;isCli&#039; =&gt; false
]
$minVersion = &#039;5.5.9&#039;
$__composer_autoload_files = [
	&#039;0e6d7bf4a5811bfa5cf40c5ccd6fae6a&#039; =&gt; true,
	&#039;34122c0574b76bf21c9a8db62b5b9cf3&#039; =&gt; true,
	&#039;c720f792236cd163ece8049879166850&#039; =&gt; true,
	&#039;ede59e3a405fb689cd1cebb7bb1db3fb&#039; =&gt; true,
	&#039;90236b492da7ca2983a2ad6e33e4152e&#039; =&gt; true,
	&#039;b1fc73705e1bec51cd2b20a32cf1c60a&#039; =&gt; true,
	&#039;667aeda72477189d0494fecd327c3641&#039; =&gt; true,
	&#039;e7223560d890eab89cda23685e711e2c&#039; =&gt; true
]
$isCli = false</pre><pre class="stack-trace">[main] - ROOT/bin/cake.php, line 32</pre></div></pre>
Welcome to CakePHP v3.2.8 Console
---------------------------------------------------------------
App : src
Path: /home/birelqar/public_html/election/src/
PHP : 5.6.24
---------------------------------------------------------------
Current Paths:

* app:  src
* root: /home/birelqar/public_html/election
* core: /home/birelqar/public_html/election/vendor/cakephp/cakephp

Available Shells:

[DebugKit] benchmark, whitespace

[Migrations] migrations

[CORE] i18n, orm_cache, plugin, routes, server

[app] console, user

To run an app or core command, type `cake shell_name [args]`
To run a plugin command, type `cake Plugin.shell_name [args]`
To get help on a specific command, type `cake shell_name --help`

Have no idea what is going on.What kind of error is this. anyone can solve this please.

Hmm, what exactly are you trying to do, if you don’t mind me asking?
It’s not really clear to me why you’d want to run the shell in a cronjob, I haven’t really considered that option to be honest.

then how to use cron in cakephp 3

Well, if you need to execute a specific controller action you can always just use curl to run it:

*/5 * * * * curl http://mydomain.com/users/update-something/

But that works independently of CakePHP.

is it possible to run a controller without curl?
with curl its not working

Is curl not installed? You can try wget instead.