0. 依赖 安装
# sudo apt-get update
# sudo apt-get install zlib1g-dev
1、进入扩展源码目录cd php源码/ext/zlib/
# cp config0.m4 config.m4
# sudo /usr/local/php/bin/phpize
# sudo ./configure --with-php-config=/usr/local/php/bin/php-config
# sudo make -j 4 && sudo make install -j 4
2. 修改php.ini 加入 sudo vim /usr/local/php/etc/php.ini
[Zlib]
extension=zlib.so