【发布时间】:2020-06-15 07:34:32
【问题描述】:
我刚刚在 Nginx Ubuntu Server 上部署了我的 laravel 项目,但每当我尝试上传图片时,我都会收到此错误
2020-06-14 21:00:32] production.ERROR: fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied {"userId":1,"exception":"[object] (ErrorException(code: 0): fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied at /var/www/laravel/vendor/league/flysystem/src/Adapter/Local.php:157)
在我的数据库中我也得到了这个/tmp/phpuFp8xC
我做错了什么?
【问题讨论】:
-
如果你可以访问命令行,给
public777 权限级别使用这个命令chmod -R 777 public确保你在 Laravel 项目根文件夹中 -
现在出现这个错误
2020-06-14 21:13:07] production.ERROR: URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) {"exception":"[object] (ErrorException(code: 0): URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) at /var/www/laravel/vendor/guzzlehttp/psr7/src/functions.php:62)