Skip to content

Instantly share code, notes, and snippets.

@dikirill
Last active February 1, 2018 20:51
Show Gist options
  • Save dikirill/846c29c68ccc7fe5cfe4c777202b4e66 to your computer and use it in GitHub Desktop.
Save dikirill/846c29c68ccc7fe5cfe4c777202b4e66 to your computer and use it in GitHub Desktop.
Install LibXL + php_excel on Ubuntu 16.04 + nginx-fpm
#based on https://gist.github.com/13i/5278899 and https://github.com/iliaal/php_excel
# or refer to better gist here: https://gist.github.com/belgattitude/999aee8eb6bd73fd0a7367ad896c76c3
sudo su --
cd /usr/src
wget http://www.libxl.com/download/libxl-lin-3.8.1.tar.gz
tar -zxvf libxl-lin-3.8.1.tar.gz
cd libxl-3.8.1.0
ln -s include_c include
ln -s lib64/libxl.so /usr/lib/libxl.so
cd /usr/include/php/20151012
git clone https://github.com/iliaal/php_excel.git ext/excel
cd ext/excel && git checkout php7
phpize
./configure --with-excel --with-libxl-incdir=/usr/src/libxl-3.8.1.0 --with-libxl-libdir=/usr/src/libxl-3.8.1.0/lib64
make
make test
make install
echo "extension=excel.so" > /etc/php/7.0/mods-available/excel.ini
ln -s /etc/php/7.0/mods-available/excel.ini /etc/php/7.0/cli/conf.d/30-excel.ini
ln -s /etc/php/7.0/mods-available/excel.ini /etc/php/7.0/fpm/conf.d/30-excel.ini
service php7.0-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment