Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
laravel 5.6中的公共路径错误_Laravel_Laravel 5.6 - Fatal编程技术网

laravel 5.6中的公共路径错误

laravel 5.6中的公共路径错误,laravel,laravel-5.6,Laravel,Laravel 5.6,我已经安装了全新的laravel 5.6,但当我打开laravel public。。。它给我的错误如下 /var/lib/jenkins/workspace/ytl/vendor/monolog/monolog/src/monolog/Handler/StreamHandler.php $this->createDir(); $this->errorMessage = null; set_error_handler(array($this, 'cust

我已经安装了全新的laravel 5.6,但当我打开laravel public。。。它给我的错误如下

/var/lib/jenkins/workspace/ytl/vendor/monolog/monolog/src/monolog/Handler/StreamHandler.php

$this->createDir();
        $this->errorMessage = null;
        set_error_handler(array($this, 'customErrorHandler'));
        $this->stream = fopen($this->url, 'a');
        if ($this->filePermission !== null) {
            @chmod($this->url, $this->filePermission);
        }
        restore_error_handler();
        if (!is_resource($this->stream)) {
            $this->stream = null;
            throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url));
        }
    }

    if ($this->useLocking) {
        // ignoring errors here, there's not much we can do about them
        flock($this->stream, LOCK_EX);
    }

    $this->streamWrite($this->stream, $record);

    if ($this->useLocking) {
        flock($this->stream, LOCK_UN);
    }
}
“流或文件 无法找到“/var/lib/jenkins/workspace/ytl/storage/logs/laravel.log” 已打开:无法打开流:权限被拒绝“


您需要在项目的根目录下运行
chmod 775-R storage
。这将允许运行PHP的用户写入该目录。您可能还需要使用
bootstrap
目录执行此操作。

可能会发生另一个错误,但web用户无权写入您的日志。非常清楚的错误消息,您是否检查了web用户在存储/日志上的权限?是@Devon另一个视图有相同的错误。。。我给了这两个文件夹777权限,然后打开了站点,这是对整个存储目录相当大的打开权限。我不建议在共享服务器上。。。如果web用户不是所有者或不属于某个组,则它仍然不可写。但是,同意,对于一些基础设施提供商,如Google App Engine和AWS Beanstalk,它是必需的。否则,这是一个更换整个目录所有者的问题。它已经工作了,但是,这对项目不好吗@NickI拥有我自己的服务器@DevonThen 775应该没问题,因为您不必担心其他人对这些目录中的文件拥有执行/读取权限。