Laravel 5 Scheduler Caching permission issue











up vote
0
down vote

favorite












I have a scheduler which caches to file.
This data is then picked up by a user when they visit a particular page.



The issue I'm having is that the scheduler is saving to the cache with the user ubuntu and the user is trying to pull this from the cache with the www-data user which leads to file permission problems.



Anyone have a decent solution to this other than setting a crontab to periodically update the cache folder permissions?










share|improve this question


















  • 1




    Why don't you place ubuntu and www-data in the same user group?
    – Joe
    May 24 '17 at 10:24










  • I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
    – johnmccuk
    May 24 '17 at 10:26















up vote
0
down vote

favorite












I have a scheduler which caches to file.
This data is then picked up by a user when they visit a particular page.



The issue I'm having is that the scheduler is saving to the cache with the user ubuntu and the user is trying to pull this from the cache with the www-data user which leads to file permission problems.



Anyone have a decent solution to this other than setting a crontab to periodically update the cache folder permissions?










share|improve this question


















  • 1




    Why don't you place ubuntu and www-data in the same user group?
    – Joe
    May 24 '17 at 10:24










  • I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
    – johnmccuk
    May 24 '17 at 10:26













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a scheduler which caches to file.
This data is then picked up by a user when they visit a particular page.



The issue I'm having is that the scheduler is saving to the cache with the user ubuntu and the user is trying to pull this from the cache with the www-data user which leads to file permission problems.



Anyone have a decent solution to this other than setting a crontab to periodically update the cache folder permissions?










share|improve this question













I have a scheduler which caches to file.
This data is then picked up by a user when they visit a particular page.



The issue I'm having is that the scheduler is saving to the cache with the user ubuntu and the user is trying to pull this from the cache with the www-data user which leads to file permission problems.



Anyone have a decent solution to this other than setting a crontab to periodically update the cache folder permissions?







php laravel-5






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 24 '17 at 9:57









johnmccuk

14617




14617








  • 1




    Why don't you place ubuntu and www-data in the same user group?
    – Joe
    May 24 '17 at 10:24










  • I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
    – johnmccuk
    May 24 '17 at 10:26














  • 1




    Why don't you place ubuntu and www-data in the same user group?
    – Joe
    May 24 '17 at 10:24










  • I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
    – johnmccuk
    May 24 '17 at 10:26








1




1




Why don't you place ubuntu and www-data in the same user group?
– Joe
May 24 '17 at 10:24




Why don't you place ubuntu and www-data in the same user group?
– Joe
May 24 '17 at 10:24












I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
– johnmccuk
May 24 '17 at 10:26




I could, but I was hoping to find a solution within Laravel. Some way of setting the user:group if possible.
– johnmccuk
May 24 '17 at 10:26












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I've run into this problem also. I've resolved this by running the artisan queue: commands as the user that owns the files. For example:



sudo -u apache ./artisan queue:restart



or



sudo -u apache ./artisan queue:flush



This prevents permissions issues since my apache user owns the storage directory and writes all the files.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44155046%2flaravel-5-scheduler-caching-permission-issue%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I've run into this problem also. I've resolved this by running the artisan queue: commands as the user that owns the files. For example:



    sudo -u apache ./artisan queue:restart



    or



    sudo -u apache ./artisan queue:flush



    This prevents permissions issues since my apache user owns the storage directory and writes all the files.






    share|improve this answer

























      up vote
      0
      down vote













      I've run into this problem also. I've resolved this by running the artisan queue: commands as the user that owns the files. For example:



      sudo -u apache ./artisan queue:restart



      or



      sudo -u apache ./artisan queue:flush



      This prevents permissions issues since my apache user owns the storage directory and writes all the files.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I've run into this problem also. I've resolved this by running the artisan queue: commands as the user that owns the files. For example:



        sudo -u apache ./artisan queue:restart



        or



        sudo -u apache ./artisan queue:flush



        This prevents permissions issues since my apache user owns the storage directory and writes all the files.






        share|improve this answer












        I've run into this problem also. I've resolved this by running the artisan queue: commands as the user that owns the files. For example:



        sudo -u apache ./artisan queue:restart



        or



        sudo -u apache ./artisan queue:flush



        This prevents permissions issues since my apache user owns the storage directory and writes all the files.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 at 18:51









        Patryk J

        12




        12






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44155046%2flaravel-5-scheduler-caching-permission-issue%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            How to ignore python UserWarning in pytest?

            Alexandru Averescu