Skip to content

Instantly share code, notes, and snippets.

@drlinux
Forked from archy-bold/libxl-php-install.sh
Created February 1, 2020 12:14
Show Gist options
  • Save drlinux/e557d1ee7dccd28e6bca09487c516508 to your computer and use it in GitHub Desktop.
Save drlinux/e557d1ee7dccd28e6bca09487c516508 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 nginx
service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment