Laravel-excel: ERR_INVALID_RESPONSE with ->download()

Created on 14 Nov 2016  路  9Comments  路  Source: Maatwebsite/Laravel-Excel

5,2 Laravel

Export

I use Digital Ocean and https://vestacp.com/ as control panel

My controller

`

namespace App\Http\ControllersAdmin;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Excel;
use App\Product;

class DashboardController extends Controller
{
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard');
}

public function exportExcel(){
    $products = Product::select('title', 'price', 'id')
        ->get();
    Excel::create('export.xls', function($excel) use($products) {

        $excel->sheet('Sheetname', function($sheet) use($products) {

            $sheet->fromModel($products);

        });

    })->download('xls');
}

}
`

But i had error ERR_INVALID_RESPONSE

Maybe i do something wrong?

Most helpful comment

Have you tried on Google Chrome?
I have the same issue in LEMP environment. You can't find the reason in chrome browser.
Try with IE. Then you will find the reason. I think the reason might have been PHP module error.
Have you installed ZipArchive module? If you are in PHP v7, then try the following.
sudo apt-get install php7.0-zip
I hope this would be able to fix your problem.

Thanks,
Alex

All 9 comments

As starting point I'd check if your server meets the requirements: http://www.maatwebsite.nl/laravel-excel/docs/getting-started

I checked this.
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

With csv all works but...
http://ipic.su/img/img7/fs/kiss_51kb.1479138880.png cyrrilic symbols doesn`t work? and how i can create 3 rows
title, price and id ?
Thanks

I need export, change prices and import again and save in DB by id.

Also check my response to this ticket: https://github.com/Maatwebsite/Laravel-Excel/issues/984 . It might be related.

i didn`t use
It is just data from DB.
Ok, i undestand, i need to be ubuntu/server side guru for using this lib on VPS... =|

<? or <?php. (I mean everything starting with

And no, it works for millions of people and most of them are no server side gurus haha.

It is joke... but i am heads up.... Yes, i use PHP -> i use but i just get data from DB and tried to send this via excel file. Documentation is ok. But.... It is VPS.... and i am not master at system adminstration... :))

Valonix, That's exactly what I met
I am using VestaCP too, and facing the same problem,
I tried that if VestaCP using nginx + PHP fpm should work fine, but use Nginx(backend) + Apache(Front-end) will show ERR_INVALID_RESPONSE.

VestaCP Apache seems do not enable php_zip, I just Installed it, but still not work, it must missing something....

Have you tried on Google Chrome?
I have the same issue in LEMP environment. You can't find the reason in chrome browser.
Try with IE. Then you will find the reason. I think the reason might have been PHP module error.
Have you installed ZipArchive module? If you are in PHP v7, then try the following.
sudo apt-get install php7.0-zip
I hope this would be able to fix your problem.

Thanks,
Alex

Was this page helpful?
0 / 5 - 0 ratings

Related issues

muhghazaliakbar picture muhghazaliakbar  路  3Comments

alejandri picture alejandri  路  3Comments

rossjcooper picture rossjcooper  路  3Comments

disto picture disto  路  3Comments

lucatamtam picture lucatamtam  路  3Comments