【问题标题】:After setting cache mask at 777, the permissions generated on the cache file is read only777设置缓存掩码后,缓存文件生成的权限为只读
【发布时间】:2013-12-09 22:53:08
【问题描述】:

我在 ubuntu 12.04 LTS 上使用 php5.3.10。

我正在运行 CakePHP 2.4.2。

这是我的 bootstrap.php

// Setup a 'default' cache configuration for use in the application.
Cache::config('default', array(
    'engine' => 'File',
    'mask' => '0777'
));

这是我的缓存文件夹

如您所见,生成的缓存文件不是 777。

我不知道还能做什么。我已经重新启动了服务器。

我已确保 tmp 文件夹为 777。

请指教。

【问题讨论】:

    标签: cakephp caching cakephp-2.0 cakephp-2.4


    【解决方案1】:

    答案是去掉掩码选项的单引号。

    // Setup a 'default' cache configuration for use in the application.
    Cache::config('default', array(
        'engine' => 'File',
        'mask' => 0777 // no single quotes!!!!
    ));
    

    不信的朋友请看一下为2.x生成core.php的模板skel的源代码

    https://github.com/cakephp/cakephp/blob/2.x/lib/Cake/Console/Templates/skel/Config/core.php#L273

    'mask' => 0664, //[optional]

    如您所见,没有引号。这对我有用。

    【讨论】:

      【解决方案2】:

      请试试这个命令

      sudo chmod -R 777 cakephp/app/tmp
      

      【讨论】:

      • 这样做无济于事
      猜你喜欢
      • 1970-01-01
      • 2015-06-04
      • 1970-01-01
      • 2018-03-15
      • 1970-01-01
      • 2013-04-28
      • 2014-02-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多