Home Index Book Sheet Format Font AutoFilter FilterColumn RichString FormControl
ConditionalFormatting ConditionalFormat CoreProperties Table Examples
ConditionalFormatting ConditionalFormat CoreProperties Table Examples
Setup LibXL in PHP for Linux
Big thank you to Ilia Alshanetsky and Jan Ehrhardt for this extension for PHP. Please follow the instructions below:1. Install Apache and PHP if they don't exist:
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install php8.x
2. Install files to develop PHP modules:
sudo apt-get install php8.x-dev 3. Download and unpack the latest LibXL package:
wget http://libxl.com/download/libxl-lin-latest.tar.gz
tar xvfz libxl-lin-4.6.0.tar.gz 4. Get the php_excel module source code:
git clone -b php7_with_pulls https://github.com/Jan-E/php_excel.git
5. Prepare the build environment for the PHP extension and configure it:
cd php_excel
phpize
./configure --with-libxl-incdir=../libxl-4.6.0/include_c --with-libxl-libdir=../libxl-4.6.0/lib64
or
./configure --with-libxl-incdir=../libxl-4.6.0/include_c --with-libxl-libdir=../libxl-4.6.0/lib for a 32-bit operating system 6. Make and install php_excel extension:
make
sudo make install
If you get the following error:
/usr/include/php5/ext/xml/expat_compat.h:36:27: fatal error: libxml/parser.h: No such file or directory
#include
then try to add "-with-libxml-dir=/usr/include/libxml2" parameter to "configure" script. 7. Add the extension to PHP configuration file:
sudo vi /etc/php/8.x/apache2/conf.d/excel.ini
Add the following line to excel.ini and save it:
extension=excel.so
8. Restart Apache web server:
sudo service apache2 restart
9. Web server is ready for using LibXL functions.
Setup LibXL in PHP for Windows
Pre-build packages for Windows can be downloaded here. To build the package for Windows on your own you may want to visit this project.See PHP code examples here.
See also this article about LibXL performance in PHP.