编译安装
Unix
Ubuntu
- # 依赖
-
- sudo apt-get install -y zlib1g-dev
-
- # 扩展
-
- git clone https://github.com/viest/php-ext-excel-export.git
-
- cd php-ext-excel-export
-
- git submodule update --init
-
- phpize && ./configure --with-php-config=/path/to/php-config
-
- make && make install
-
- # 添加 extension = xlswriter.so 到 ini 配置
Mac
- # 依赖
-
- brew install zlib
-
- # 扩展
-
- git clone https://github.com/viest/php-ext-excel-export.git
-
- cd php-ext-excel-export
-
- git submodule update --init
-
- phpize && ./configure --with-php-config=/path/to/php-config
-
- make && make install
-
- # 添加 extension = xlswriter.so 到 ini 配置
Windows
依赖
请预先搭建PHP编译环境,教程详见 php.net
- cd PHP_BUILD_PATH/deps
-
- DownloadFile http://zlib.net/zlib-1.2.11.tar.gz
- 7z x zlib-1.2.11.tar.gz > NUL
- 7z x zlib-1.2.11.tar > NUL
- cd zlib-1.2.11
- cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="/MT"
- cmake --build . --config "Release"
扩展
- cd PHP_PATH/ext
-
- git clone https://github.com/viest/php-ext-excel-export.git
-
- cd EXT_PATH
-
- git submodule update --init
-
- phpize
-
- configure.bat --with-xlswriter --with-extra-libs=PATH\zlib-1.2.11\Release --with-extra-includes=PATH\zlib-1.2.11
-
- nmake