0

I'm using symfony3 and trying to install/use TwigExcelBundle on my ubuntu16 server for an excel exporting purpose. I can install it by when I try to use I get the following error :

"Attempted to load class "ZipArchive" from the global namespace. Did you forget a "use" statement for "PHPExcel_Shared_ZipArchive"?" at /home/web/dgb/vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007.php line 227

I tried to manually install the php7.0-zip extension but it failed :

apt-get install php7.0-zip ...... Les paquets suivants contiennent des dépendances non satisfaites : php7.0-zip : Dépend: php7.0-common (= 7.0.30-1~dotdeb+8.1) mais 7.0.18-1~dotdeb+8.1 devra être installé Dépend: libzip2 (>= 0.11.2) mais il n'est pas installable E: Dépendances non satisfaites. Essayez « apt-get -f install » sans paquet (ou indiquez une solution).

NB : It works fine on my localhost (windows)

Please tell me the solution. What should I do to resolve the problem? Or anyone can suggest me another tool to export excel file using symfony3?

Lacky Raz
  • 1
  • 1
  • 1

2 Answers2

1

Have a look at this answer, could be the same situation described.

You only need to purge the packages and install the rigth distribution for your operating system.

Hope it helps!!

Juan I. Morales Pestana
  • 1,057
  • 1
  • 10
  • 34
0

Should do what your installation want, run:

$ apt-get -f install

Or you could try with PHPSpreadsheet :https://packagist.org/packages/phpoffice/phpspreadsheet

Zahori
  • 446
  • 1
  • 4
  • 16