zoukankan      html  css  js  c++  java
  • phpize的深入理解

    安装(fastcgi模式)的时候,常常有这样一句命令:/usr/local/webserver/php/bin/phpize
    一、phpize是干嘛的?
    phpize是什么东西呢?php官方的说明:
    http://php.net/manual/en/install.pecl.phpize.php
    phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
    比如你想在原来编译好的php中加入memcached或者ImageMagick等扩展模块,可以使用phpize,通过以下几步工作。
    二、如何使用phpize?
    当php编译完成后,php的bin目录下会有phpize这个脚本文件。在编译你要添加的扩展模块之前,执行以下phpize就可以了;
    比如现在想在php中加入memcache扩展模块:我们要做的只是如下几步
    ————————————————————————
    tar zxvf memcache-2.2.5.tgz
    cd memcache-2.2.5/
    /usr/local/webserver/php/bin/phpize
    ./configure –with-php-config=/usr/local/webserver/php/bin/php-config
    make
    make install
    ————————————————————————
    注意./configure 后面可以指定的是php-config文件的路径
    这样编译就完成了,还需要做的是在php.ini文件中加入extension值
    extension = “memcache.so”
    ---------------------------------------------------------
    注意:Cannot find config.m4.
    这个错误是一个很傻的错误,解压以后需要cd到文件夹,不然phpize就会报错

    动态编译PHP的memcache扩展库,在执行/usr/localphp/bin/phpize时出现了错误,
    Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
    很明显缺少文件,需要安装。网上找了下资料。
    # wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
    # tar -zvxf m4-1.4.9.tar.gz
    # cd m4-1.4.9/
    # ./configure && make && make install
    # cd ../
    # wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
    # tar -zvxf autoconf-2.62.tar.gz
    # cd autoconf-2.62/
    # ./configure && make && make install
    然后执行以下命令进行安装
    #/usr/local/php/bin/phpize
    #./configure –prefix=/usr/local/memcached –with-libevent=/usr/local/libevent –with-php-config=/usr/local/php/bin/php-config
    #make && make install

  • 相关阅读:
    BZOJ2648: SJY摆棋子
    BZOJ1925: [Sdoi2010]地精部落
    BZOJ1941: [Sdoi2010]Hide and Seek
    BZOJ2434: [Noi2011]阿狸的打字机
    BZOJ3295: [Cqoi2011]动态逆序对
    BZOJ1406: [AHOI2007]密码箱
    BZOJ1115: [POI2009]石子游戏Kam
    BZOJ1531: [POI2005]Bank notes
    BZOJ2730: [HNOI2012]矿场搭建
    计算几何《简单》入土芝士
  • 原文地址:https://www.cnblogs.com/phpxuetang/p/5057364.html
Copyright © 2011-2022 走看看