Skip to content

Instantly share code, notes, and snippets.

@archy-bold
Last active February 1, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save archy-bold/361a05fb0d5b572f96f51c122edb2c61 to your computer and use it in GitHub Desktop.
Save archy-bold/361a05fb0d5b572f96f51c122edb2c61 to your computer and use it in GitHub Desktop.
Install LibXL for PHP
#!/bin/sh
# Ensure we've got libxml2
apt-get update
apt-get install libxml2-dev
# Make /src directory, if required
mkdir /src
cd /src
# Get libxl, change based on version
wget http://libxl.com/download/libxl-lin-3.8.0.tar.gz
tar -xvf libxl-lin-3.8.0.tar.gz
# Install libxl
cd libxl-3.8.0.0/
cp lib64/libxl.so /usr/lib/libxl.so
cp -r include_c/ /usr/include/libxl_c
cd ..
# Get php_excel
wget -q -O php_excel.zip https://github.com/iliaal/php_excel/archive/master.zip
unzip php_excel.zip
# Install php_excel
cd php_excel-master/
phpize
./configure --with-libxl-incdir=/src/libxl-3.8.0.0/include_c --with-libxl-libdir=/src/libxl-3.8.0.0/lib64 --with-libxml-dir=/usr/include/libxml2/ --with-excel=/src/libxl-3.8.0.0
make
make install
# Restart apache
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment