Tuesday, June 9, 2015

Re: Console, shell and cronjob woes

Change as:

app/Config/core.php

Cache::config('_cake_core_', array(
….
'mask' => 0777,
));

Cache::config('_cake_model_', array(
….
'mask' => 0777,
));

https://github.com/cakephp/cakephp/blob/2.7/app/Config/core.php#L294

delete all the temp files inside app/tmp/cache/persistent app/tmp/cache/models

sudo chmod -R 777 tmp/

it should work fine after…


Andras

> On Jun 9, 2015, at 7:44 AM, phpMagpie <paul@highten.co.uk> wrote:
>
> Hi,
>
> I'm trying to get a cronjob working in CakePHP 2.5. I am using Croogo 2.2.2 and my Cake core is centrally stored and used by all CakePHP apps by changing the CAKE_CORE_INCLUDE_PATH in app/webroot/index.php
>
> The shell is created, I can execute it from the CLI (whilst logged into server as root) using a variety of commands and it runs fine. However, when I add the cronjob into my system the shell spits out the following errors:
>
> PHP Warning: _cake_core_ cache was unable to write 'cake_dev_eng' to File cache in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php on line 323
>
> Warning: _cake_core_ cache was unable to write 'cake_dev_eng' to File cache in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php on line 323
>
> PHP Warning: /home/user/domains/domain.co.uk/public_html/tmp/cache/persistent/ is not writable in /home/lib/cake/cake25/lib/Cake/Cache/Engine/FileEngine.php on line 385
>
> Warning: /home/user/domains/domain.co.uk/public_html/tmp/cache/persistent/ is not writable in /home/lib/cake/cake25/lib/Cake/Cache/Engine/FileEngine.php on line 385
>
> PHP Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php:181
> Stack trace:
> #0 /home/lib/cake/cake25/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')
> #1 /home/user/domains/domain.co.uk/public_html/Config/croogo.php(314): Cache::config('_cake_core_', Array)
> #2 /home/user/domains/domain.co.uk/public_html/Config/core.php(4): require('/home/user...')
> #3 /home/lib/cake/cake25/lib/Cake/Core/Configure.php(72): include('/home/user...')
> #4 /home/lib/cake/cake25/lib/Cake/bootstrap.php(175): Configure::bootstrap(true)
> #5 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(138): require('/home/lib/cake/...')
> #6 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(100): ShellDispatcher->_bootstrap()
> #7 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
> #8 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(65 in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php on line 181
>
> Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php:181
> Stack trace: #0 /home/lib/cake/cake25/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')
> #1 /home/user/domains/domain.co.uk/public_html/Config/croogo.php(314): Cache::config('_cake_core_', Array)
> #2 /home/user/domains/domain.co.uk/public_html/Config/core.php(4): require('/home/user...')
> #3 /home/lib/cake/cake25/lib/Cake/Core/Configure.php(72): include('/home/user...')
> #4 /home/lib/cake/cake25/lib/Cake/bootstrap.php(175): Configure::bootstrap(true)
> #5 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(138): require('/home/lib/cake/...')
> #6 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(100): ShellDispatcher->_bootstrap()
> #7 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
> #8 /home/lib/cake/cake25/lib/Cake/Console/ShellDispatcher.php(65 in /home/lib/cake/cake25/lib/Cake/Cache/Cache.php on line 181
>
> Any ideas?
>
> Thx, Paul.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: