无效配置–yiiaseInvalidConfigException Web进程无法写入目录


Invalid Configuration – yiiaseInvalidConfigException The directory is not writable by the Web process?

无效配置–yii''base''InvalidConfigException

Web进程无法写入目录:

/home/liyunfei/NetBeansProjects/my2/duangplat/publicplat/web/assets

1. in /home/liyunfei/NetBeansProjects/my2/duangplat/vendor/yiisoft/yii2/web/AssetManager.php at line 213
204205206207208209210211212213214215216217218219220221222
     * @throws InvalidConfigException if [[basePath]] is invalid
     */
    public function init()
    {
        parent::init();
        $this->basePath = Yii::getAlias($this->basePath);
        if (!is_dir($this->basePath)) {
            throw new InvalidConfigException("The directory does not exist: {$this->basePath}");
        } elseif (!is_writable($this->basePath)) {
            throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}");
        } else {
            $this->basePath = realpath($this->basePath);
        }
        $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
    }
    /**
     * Returns the named asset bundle.

我知道这是一篇旧帖子,但如果它能帮助到某人:

SELinux(例如,在Centos 7上)默认情况下处于启用状态。出于我的目的,我只是将SELinux设置为允许模式,这为我解决了这个问题。也就是说,可能有一种最佳实践可以允许apache进程不进入允许模式。

当我从web文件夹中删除捆绑资产文件夹时,遇到了这个问题。一个小时后,我找到了它,我在网上创建了一个资产文件夹,它已经修复了。