Laravel-excel: [QUESTION] can not export from remote production server but works fine in local dev.

Created on 30 Jan 2017  路  8Comments  路  Source: Maatwebsite/Laravel-Excel

Package version, Laravel version

maatwebsite/excel 2.1.6 , Laravel 5.3

localbox: LAMP+php5.6+Laravel5.3
production box: Ubuntu 16.10+nginx/1.10.1 (Ubuntu)+php7.0+Laravel5.3

code in my controller:

... ...
return Excel::create('templete', function($excel) use ($data) {
$excel->sheet('rateTemplete', function($sheet) use ($data)
{
$sheet->fromArray($data);
});
})->download($type); //here $type =csv

error

download (export) function works fine on my dev box. but when I push it to production server. this download function will return error in Chrome like:
this site can鈥檛 be reached

The webpage at http://........../downloadTempleteExcel/csv might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE

Any hint?

Most helpful comment

I believe my issue ended up being that I didn't have php_zip enabled on the server.

All 8 comments

sorry, a little correction i have maatwebsite/excel 2.1.10 instead of 2.1.6 mentioned above.

it sound to me that my production server's file system does not have enough permission to save the temp file... But I could be wrong,

Can any one please let me know where is the export temp file on the server? thanks!

Yeah, seems to me it's a permission issue. It works both on my local and production server. Exported files should be on the storage/exports directory, except if you change the config/excel.php file

I'm having the same issue, but when I looked under storage I don't see an exports directory on either my dev or production instance. The download works fine on dev, but I get the same error on production.

I'm on the same Laravel, PHP and Laravel-Excel versions as @topegret, but I'm using Apache 2 instead of nginx. I'll post here if I find a fix.

Do you have excel.php in your config directory?

I believe my issue ended up being that I didn't have php_zip enabled on the server.

Nice to here from you ++

I have php zip installed on the server but it still does not work. Any ideas ?

Was this page helpful?
0 / 5 - 0 ratings