Install via Composer
Install Composer
If you don’t have Composer installed, download it from getcomposer.org.
System requirements
PHP version
PhpSpreadsheet requires PHP 8.1 or higher.Support for PHP versions is maintained for six months beyond their official end of life. The current minimum version (8.1) will be supported until June 30, 2026.
Required PHP extensions
The following PHP extensions are required for PhpSpreadsheet to function:- ext-ctype - Character type checking
- ext-dom - DOM document manipulation
- ext-fileinfo - File information
- ext-filter - Data filtering
- ext-gd - Image processing
- ext-iconv - Character encoding conversion
- ext-libxml - XML library
- ext-mbstring - Multibyte string handling
- ext-simplexml - Simple XML parsing
- ext-xml - XML parsing
- ext-xmlreader - XML reader
- ext-xmlwriter - XML writer
- ext-zip - ZIP archive handling
- ext-zlib - Compression
Composer dependencies
PhpSpreadsheet automatically installs the following required packages:maennchen/zipstream-php(^2.1 || ^3.0) - Streaming ZIP archivesmarkbaker/complex(^3.0) - Complex number calculationsmarkbaker/matrix(^3.0) - Matrix calculationspsr/simple-cache(^1.0 || ^2.0 || ^3.0) - Caching interface
Optional dependencies
PDF export libraries
To export spreadsheets to PDF format, install one of these libraries:Chart rendering
To render charts or include charts with PDF/HTML writers:Internationalization
For number format wizards and locale support:Verifying installation
Create a test file to verify your installation:test.php
Troubleshooting
Missing extensions
If Composer reports missing extensions:Ubuntu/Debian
Ubuntu/Debian
macOS (Homebrew)
macOS (Homebrew)
Most extensions are included with PHP. For missing ones:
Windows
Windows
Edit your
php.ini file and uncomment (remove ; from) the required extensions:Memory limits
For large spreadsheets, you may need to increase PHP’s memory limit:php.ini:
Next steps
Quick start
Now that you’ve installed PhpSpreadsheet, learn how to create your first spreadsheet

