在Debian 上安装php zip扩展

cd /usr/local/src
# wget http://pecl.php.net/get/zip-1.13.5.tgz
# tar -xf zip-1.13.5.tgz
# cd zip-1.13.5
# phpize 或者/usr/local/php/bin/phpize
# ./configure -with-php-config=/usr/bin/php-config7.0
# make && make install

问题:

  • bash: phpize: command not found
    解决
    先看下版本: php -v # 比如我的版本是php7.0的
    安装: sudo apt-get install php7.0-dev
    执行: phpize

  • debian configure: error: zip support requires ZLIB. Use --with-zlib-dir=

    to specify prefix where ZLIB include and library are located
    解决:

    apt-get install zlib1g-dev

补充:

  • phpenmod moduleName enables a module to php7 (restart apache after that sudo service apache2 restart)
  • phpdismod moduleName disables a module to php7 (restart apache after that sudo service apache2 restart)
  • php -m lists the loaded modules

你可能感兴趣的:(PHP,服务器)