Console, shell and cronjob woes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Console, shell and cronjob woes

phpMagpie-2
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Console, shell and cronjob woes

phpMagpie-2
Update: 
As I could run this as root I decided to create a cronjob as root and this works.

However, I want to create cronjobs under each user on the server rather than as root.  So I now need to know why CakePHP/Croogo behaves differently depending on which user is running a cronjob even though I'm using the same command and the user/group the site belongs to has the necessary rights.

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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Console, shell and cronjob woes

Andras Kende
In reply to this post by phpMagpie-2
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 <[hidden email]> 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 [hidden email].
> To post to this group, send email to [hidden email].
> 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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Console, shell and cronjob woes

phpMagpie-2
Andras,

Thanks for your reply, it has pointed me on the right path to solving this.

Whilst this is a cache permissions error, I don't think I should need to change the way I apply permissions.  

I chown apache:apache my tmp folders for all cakephp apps, so it would seem that I just need to figure out why the user which runs the cronjob is not a member of the apache:apache group.

Thanks again, Paul.

On Tuesday, June 9, 2015 at 8:08:35 PM UTC+1, Andras Kende wrote:
Change as:

app/Config/core.php

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

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

<a href="https://github.com/cakephp/cakephp/blob/2.7/app/Config/core.php#L294" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fcakephp%2Fcakephp%2Fblob%2F2.7%2Fapp%2FConfig%2Fcore.php%23L294\46sa\75D\46sntz\0751\46usg\75AFQjCNFiGfNffiC9FbNyBHJwnTa9Y-L9Rw';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fcakephp%2Fcakephp%2Fblob%2F2.7%2Fapp%2FConfig%2Fcore.php%23L294\46sa\75D\46sntz\0751\46usg\75AFQjCNFiGfNffiC9FbNyBHJwnTa9Y-L9Rw';return true;">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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Exo_0BDUaXIJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">pa...@...> 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/<a href="http://domain.co.uk/public_html/tmp/cache/persistent/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2Ftmp%2Fcache%2Fpersistent%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF3zK_IRYUP5AAhjTXqkFSWBv2BJw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2Ftmp%2Fcache%2Fpersistent%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF3zK_IRYUP5AAhjTXqkFSWBv2BJw';return true;">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/<a href="http://domain.co.uk/public_html/tmp/cache/persistent/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2Ftmp%2Fcache%2Fpersistent%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF3zK_IRYUP5AAhjTXqkFSWBv2BJw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2Ftmp%2Fcache%2Fpersistent%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNF3zK_IRYUP5AAhjTXqkFSWBv2BJw';return true;">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/<a href="http://domain.co.uk/public_html/Config/croogo.php(314)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcroogo.php(314)\46sa\75D\46sntz\0751\46usg\75AFQjCNFND6hgINM5OrJ33T_XROm8dIbYhw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcroogo.php(314)\46sa\75D\46sntz\0751\46usg\75AFQjCNFND6hgINM5OrJ33T_XROm8dIbYhw';return true;">domain.co.uk/public_html/Config/croogo.php(314): Cache::config('_cake_core_', Array)
> #2 /home/user/domains/<a href="http://domain.co.uk/public_html/Config/core.php(4)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcore.php(4)\46sa\75D\46sntz\0751\46usg\75AFQjCNFkS3_TuSUutU4MjViGZ-cFuFbqPQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcore.php(4)\46sa\75D\46sntz\0751\46usg\75AFQjCNFkS3_TuSUutU4MjViGZ-cFuFbqPQ';return true;">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/<a href="http://domain.co.uk/public_html/Config/croogo.php(314)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcroogo.php(314)\46sa\75D\46sntz\0751\46usg\75AFQjCNFND6hgINM5OrJ33T_XROm8dIbYhw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcroogo.php(314)\46sa\75D\46sntz\0751\46usg\75AFQjCNFND6hgINM5OrJ33T_XROm8dIbYhw';return true;">domain.co.uk/public_html/Config/croogo.php(314): Cache::config('_cake_core_', Array)
> #2 /home/user/domains/<a href="http://domain.co.uk/public_html/Config/core.php(4)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcore.php(4)\46sa\75D\46sntz\0751\46usg\75AFQjCNFkS3_TuSUutU4MjViGZ-cFuFbqPQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fdomain.co.uk%2Fpublic_html%2FConfig%2Fcore.php(4)\46sa\75D\46sntz\0751\46usg\75AFQjCNFkS3_TuSUutU4MjViGZ-cFuFbqPQ';return true;">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 <a href="https://www.facebook.com/CakePHP" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.facebook.com%2FCakePHP\46sa\75D\46sntz\0751\46usg\75AFQjCNG_OVGPrsW2S4xCvT0yb2leRWBsQg';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.facebook.com%2FCakePHP\46sa\75D\46sntz\0751\46usg\75AFQjCNG_OVGPrsW2S4xCvT0yb2leRWBsQg';return true;">https://www.facebook.com/CakePHP
> Find us on Twitter <a href="http://twitter.com/CakePHP" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftwitter.com%2FCakePHP\46sa\75D\46sntz\0751\46usg\75AFQjCNGm99t3RztzLJAbpv22cUAOb0aFHw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftwitter.com%2FCakePHP\46sa\75D\46sntz\0751\46usg\75AFQjCNGm99t3RztzLJAbpv22cUAOb0aFHw';return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Exo_0BDUaXIJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">cake-php+u...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Exo_0BDUaXIJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">cake...@....
> Visit this group at <a href="http://groups.google.com/group/cake-php" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/cake-php';return true;" onclick="this.href='http://groups.google.com/group/cake-php';return true;">http://groups.google.com/group/cake-php.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Console, shell and cronjob woes

phpMagpie-2
@Andras: You should avoid using 777 as that gives read/write/execute access to the world, which is a major security concern.

Further information on this:

When a web page loads, any files written/updated within tmp folders are given apache:apache (user:group) access.

When a cronjob runs, any files written/updated within tmp folders are given user:user (user:group) access.  

If apache cannot read/write from these files it can cause Fatal PHP errors and web pages fail to load

If user cannot read/write from these files it can cause Fatal PHP errors which cause cronjobs not to run

How do I create a setup where apache and user cronjobs can run and update tmp files without breaking everything?

Thanks, 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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Console, shell and cronjob woes

Andras Kende
Hi Paul,

The 777 indeed the quick fix of doing it :(

or 


Andras

On Jun 10, 2015, at 4:01 AM, phpMagpie <[hidden email]> wrote:

@Andras: You should avoid using 777 as that gives read/write/execute access to the world, which is a major security concern.

Further information on this:

When a web page loads, any files written/updated within tmp folders are given apache:apache (user:group) access.

When a cronjob runs, any files written/updated within tmp folders are given user:user (user:group) access.  

If apache cannot read/write from these files it can cause Fatal PHP errors and web pages fail to load

If user cannot read/write from these files it can cause Fatal PHP errors which cause cronjobs not to run

How do I create a setup where apache and user cronjobs can run and update tmp files without breaking everything?

Thanks, 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 [hidden email].
To post to this group, send email to [hidden email].
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.