'How to include phpspreadsheet library without composer?
There isn't a way for me to run composer on my server for a bunch of reasons. Is there any way to include all the files necessary to use the library?
Solution 1:[1]
@Lubosdz answered the question in the right way here:
How to use PhpSpreadsheet without installation (like PHPExcel)
Just coping files isn't enaugh to get it worked because composer is used to autoload all PhpSpreadSheet classes.
Without composer, you have to create your custom ones.
You can find a 4 steps method, files, and code here:
https://github.com/PHPOffice/PhpSpreadsheet/issues/31#issuecomment-354502740
Solution 2:[2]
07 2021
If any of you still looking for the solution. Then here it is.
How to run PhpSpreadsheet on a Server without Composer
See @delboy1978uk comment above
Run PhpSpreadsheet locally without Composer
Official:
Composer is the only official and supported solution to use PhpSpreadsheet. Alternative custom solutions are possible, but I'd strongly advise against them. Not using composer will give you more work to set up, and potential issues to maintain.
https://github.com/PHPOffice/PhpSpreadsheet/discussions/1969#discussioncomment-545159
Solution 3:[3]
As @delboy1978uk stated in the answer above:
- Run composer local on your machine,
- create the composer.json,
- require phpspreadsheet (https://packagist.org/packages/phpoffice/phpspreadsheet)
- composer update
- upload the complete /vendor Folder on your server, maybe as zip it is easier,
- include /vendor/autoload.php,
- there it is
And send a Sixpack of your favorite Beer to Mark Baker https://github.com/MarkBaker for his great work :-)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | double-beep |
| Solution 2 | Dexter |
| Solution 3 | Wolfgang Blessen |
