Home Index Book Sheet Format Font AutoFilter FilterColumn RichString FormControl
ConditionalFormatting ConditionalFormat CoreProperties Table Examples
ConditionalFormatting ConditionalFormat CoreProperties Table Examples
Setup LibXL in PHP
Many thanks to Ilia Alshanetsky for the php_excel extension for PHP 8.3+. Read his post with installation instructions, examples and benchmarks. For older PHP versions please use the php extension from Jan Ehrhardt.Also special thanks to Maxim Shuguroff for the additional php extension for PHP8.2+, Johannes Mueller, Philip Hofstetter, Stephan Fischer, Pierre Joye and Darren Odden for additional contributions.
Linux / macOS
The easiest path is PIE (PHP Installer for Extensions), the official PECL replacement:pie install iliaal/php-excel \ --with-libxl-incdir=/opt/libxl/include_c \ --with-libxl-libdir=/opt/libxl/lib64
git clone https://github.com/iliaal/php_excel.git cd php_excel phpize ./configure --with-excel \ --with-libxl-incdir=/opt/libxl/include_c \ --with-libxl-libdir=/opt/libxl/lib64 make sudo make install
extension=excel.so
echo "/opt/libxl/lib64" | sudo tee /etc/ld.so.conf.d/libxl.conf sudo ldconfig
Windows
Pre-built DLLs for PHP 8.3 and 8.4 (both x64 and x86, TS and NTS) are attached to every GitHub release. Download the DLL matching your PHP version and architecture, drop it into your ext directory, and add to php.ini:extension=excel
License key
If you have a LibXL license, store the credentials in php.ini rather than your source code:[excel] excel.license_name="Your Name" excel.license_key="your-license-key-here"
The extension is open source under the PHP-3.01 license.
See PHP code examples here.
See also this article about LibXL performance in PHP.