laravel - laravel 5.6 中的公共(public)路径错误

标签 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, '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/

相关文章:

php - Laravel 在路由中追加 URI

filesystems - 如何从 Laravel 5.6 中的 SFTP 下载目录中列出的所有文件

php - 如何在 Laravel 5.6 json 响应中将空值转换为空字符串?

拉拉维尔 5 : How to use array_get method to access an attribute with a dot inside

php - Laravel 身份验证 - Auth::check 返回 FALSE

javascript - Laravel5.5路由; 500内部服务器错误)

php - 如何在 Laravel 中合并两个请求

Laravel 4 错误 : Undefined method shutdown

php - 单页应用程序的访问控制列表

laravel - 预期响应代码 220,但在 laravel 5.6 中得到空响应