Closed magicua closed 2 years ago
Facing the same issue on Ubuntu 20.04 server, this solution worked for me:
https://unix.stackexchange.com/questions/503111/group-permissions-for-root-not-working-in-tmp
PR 2657, which I hope will resolve this problem, was just merged. If you have a way to test against master, please do so.
No update in 4 months. I believe it is fixed. Closing.
Any updates here? I am having same issue.
The code which was believed responsible was changed over a year ago. If you are having a problem, please open a new issue with your particular details.
Hello.
This is a bug report
I am getting the following error:
[2021-11-05 15:18:37] production.ERROR: fopen(/var/www/applications/.../storage/framework/laravel-excel/laravel-excel-scZOjOuy25S7MOmMyXnRYzntkoCoLJxZ.xlsx): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): fopen(/var/www/applications/.../storage/framework/laravel-excel/laravel-excel-scZOjOuy25S7MOmMyXnRYzntkoCoLJxZ.xlsx): failed to open stream: Permission denied at /var/www/applications/.../vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php:123) [stacktrace]
0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fopen(/var/www/...', '/var/www/applic...', 123, Array)
1 /var/www/applications/.../vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php(123): fopen('/var/www/applic...', 'wb+')
but the rights to the file are correct: -rw-r--r-- 1 www-data www-data 0 Nov 5 13:15 /var/www/applications/.../storage/framework/laravel-excel/laravel-excel-scZOjOuy25S7MOmMyXnRYzntkoCoLJxZ.xlsx
probably the problem is in the file phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php in the line 118
$mode = 'wb+';
I think it is necessary to write:
$mode = 'w+b';
because the documentation states: https://www.php.net/manual/en/function.fopen.php To use these flags, specify either 'b' or 't' as the last character of the mode parameter.