PHP_XLSXWriter icon indicating copy to clipboard operation
PHP_XLSXWriter copied to clipboard

Question: Requirements on Docker

Open sh-at-bergnet-de opened this issue 1 year ago • 1 comments

I have written an app with an Excel output. When I use it with DDEV (PHP 8.2, MariaDB 10.6, otherwise default settings) everything works as desired. However, if I start the app with Docker there are problems opening it in MS Excel. However, 7zip can unzip the file and alternative programs open the file without problems.

The Docker image is based on php:8.2-apache . I suspect an external dependency, so I compared the loaded modules and adjusted some, e.g. bz2, unfortunately without success. In the following list modules that are loaded in DDEV but Docker are not marked with a dot / plus-sign. Maybe someone here has an idea what I need to adjust to make it work?

[PHP Modules]

  • apcu
  • bcmath bz2
  • calendar core ctype curl date dom
  • exif
  • FFI fileinfo filter ftp
  • gd
  • gettext hash iconv
  • igbinary
  • imagick intl json
  • ldap libxml mbstring
  • memcached
  • msgpack mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql
  • pdo_pgsql pdo_sqlite
  • pgsql Phar posix random readline
  • redis reflection session
  • shmop SimpleXML
  • soap
  • sockets sodium SPL sqlite3 standard
  • sysvmsg
  • sysvsem
  • sysvshm tokenizer
  • uploadprogress xml xmlreader
  • xmlrpc xmlwriter
  • xsl
  • Zend OPcache zip zlib

[Zend Modules]

  • Zend OPcache

sh-at-bergnet-de avatar Aug 03 '23 06:08 sh-at-bergnet-de

"if I start the app with Docker there are problems opening it in MS Excel". An xlsx file is just a zip file. Open your xlsx/zip file in a hex editor or text editor and see if there are any php errors before the PK \x50\x4b\x03\x04 header. Its usually php.ini settings like display_errors=On or a /tmp dir issue that corrupt these files.

mk-j avatar Aug 03 '23 15:08 mk-j