Laravel保留chmod存储文件夹

时间:2019-02-08 04:40:46

标签: php laravel permissions vagrant chmod

当我在laravel应用程序中访问视图时,为什么总是每1分钟显示该错误:

file_put_contents(/home/vagrant/Code/myproject/storage/framework/cache/data/db/59/db59a863cb50aaccca0c973c049bd67971a7e3ae): failed to open stream: Permission denied吗?

当我运行chmod -R 777 storage/时,它可以工作,但随后每隔1分钟就会更改一次权限。

即使我这样做:

  • php artisan config:cache
  • php artisan cache:clear
  • php artisan view:clear
  • php artisan clear-compiled
在我的本地计算机上

不适用于我。

我正在使用:

  • Mac OS High Sierra 10.13.3
  • 流浪者2.0.2(ubuntu18.04)
  • Laravel 5.5
  • PHP 7.2

请帮助。谢谢您的回答。

2 个答案:

答案 0 :(得分:1)

使用prices = prices.set_index('datetime').asfreq('1Min') print(prices) open high low close datetime 2019-02-07 16:00:00 124.634 124.624 124.650 124.620 2019-02-07 16:01:00 NaN NaN NaN NaN 2019-02-07 16:02:00 NaN NaN NaN NaN 2019-02-07 16:03:00 NaN NaN NaN NaN 2019-02-07 16:04:00 124.624 124.627 124.647 124.617 更改整个项目的所有者。设置新的所有者chown

www-data

答案 1 :(得分:0)

我尝试了以下方法,并且对我有用:

 public class MyViewCell : ViewCell
    {
        private Color BackgroundColor
        {
            get => CellGloss.GetBackgroundColor(this);
            set => CellGloss.SetBackgroundColor(this, value);
        }

        public Color EvenColor { get; set; }
        public Color UnevenColor { get; set; }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (!(Parent is ListView listView))
                throw new Exception(
                    $"The Binding Context is not {typeof(ListView)}. This component works only with {typeof(ListView)}.");

            int index;
            if (listView.IsGroupingEnabled)
            {
                index = listView.TemplatedItems.GetGroupAndIndexOfItem(BindingContext).Item2;
            }
            else
            {
                index = listView.TemplatedItems.IndexOf(this);
            }

            if (index != -1)
                BackgroundColor = index % 2 == 0 ? EvenColor : UnevenColor;
        }
    }

更改以下参数:

<components:MyViewCell EvenColor="White" UnevenColor="#eeeeee">

收件人:

sudo nano /etc/php/7.2/fpm/pool.d/www.conf

记住要重新启动PHP FPM

user = www-data
group = www-data