User Tools

Site Tools


php_readwrite_ods_files

If you want to send us your comments, please do so. Thanks
More on comments


PHP Read / Write .ods files

See


.ods examples

PHPspreadsheet installation

One installation, about 10 MB, per project. There is no general spot to install to

  • Install PHP, or without Apache
  • Install composer
  • Install, as root, with aptitude
    • php-gd
    • Maybe needed
      • php_zip
      • php-xml which installs php_xmlreader

Run as user

cd toWhereYourProjectIs
/usr/local/bin/composer/composer.phar require phpoffice/phpspreadsheet

Issues

requirements could not be resolved

Your requirements could not be resolved to an installable set of packages.                                                                                                  
                                                                                                                                                                          
Problem 1                                                                                                                                                                 
  - Root composer.json requires phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0].                                                        
  - phpoffice/phpspreadsheet 1.18.0 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.

Solution: install php-gd

In ArrayLoader.php

In ArrayLoader.php line 44:

Solution:

  • Check if you are running the right version of composer
    • Run composer version
      • If it results in the same error: “In ArrayLoader.php line 44:”
        • Uninstall, with aptitude composer (which is version 1). Do not uninstall the dependencies (deselect them with +)
  • composer if you have not already done so
  • Rerun the command: /usr/local/bin/composer/composer.phar require phpoffice/phpspreadsheet

Root package cannot require itself

Root package ''phpoffice/phpspreadsheet' cannot require itself in its composer.json

Solution: For now: Remove the “vendor” directory and reinstall everything that was in it

Spout installation

  • With aptitude install
    • php_zip
    • php-xml which installs php_xmlreader
  • run /usr/local/bin/composer/composer.phar require box/spout

This should output

Using version ^3.3 for box/spout
./composer.json has been created
Running composer update box/spout
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking box/spout (v3.3.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading box/spout (v3.3.0)
  - Installing box/spout (v3.3.0): Extracting archive
  - package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files

Run /usr/local/bin/composer/composer.phar suggest

box/spout suggests:
  - ext-intl: To handle non UTF-8 CSV files (if "iconv" is not already installed)

When PHP is installed php-common is installed which provides iconv

Removal

Running

/home/user/vendor/box/spout $ /usr/local/bin/composer/composer.phar remove box/spout

yielded, to our supprise

13 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package sebastian/resource-operations is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files

so spout is updated, not removed it seems
Or

cd /home/user/box/spout
/usr/local/bin/composer/composer.phar remove /box/spout

yielded

spout is not required in your composer.json and has not been removed

We do not understand this
Our solution, we manually removed the box/spout directory:

/home/user/vendor $ rm --recursive --force box/

Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
php_readwrite_ods_files.txt · Last modified: 05-11-2021 10:25 by wim