我已经安装了新的 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);
}
}
"The stream or file "/var/lib/jenkins/workspace/ytl/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied"
最佳答案
您需要在项目的根目录运行chmod 775 -R storage
。这将允许运行 PHP 的用户写入该目录。您可能还需要使用 bootstrap
目录来执行此操作。
关于laravel - laravel 5.6 中的公共(public)路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50978745/