zoukankan      html  css  js  c++  java
  • Linux下php5.3.3安装mcrypt扩展

    具体操作:

    一、下载软件包

    1、下载php(版本要与系统安装的一致)

    http://pan.baidu.com/s/1mifTbfE

    2、下载libmcrypt(安装mcrypt需要此软件包)

    http://pan.baidu.com/s/1mifTbfE

    3、下载mhash(安装mcrypt需要此软件包)

    http://pan.baidu.com/s/1mifTbfE

    4、下载mcrypt

    http://pan.baidu.com/s/1mifTbfE

    或者:

    wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1430725959&use_mirror=ncu
     
    wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F&ts=1430726021&use_mirror=ncu
     
    wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F&ts=1430726218&use_mirror=ncu
    wget http://museum.php.net/php5/php-5.3.3.tar.gz

    以上软件包下载之后,上传到/usr/local/src目录

    二、安装软件包

    1、安装libmcrypt

    cd /usr/local/src  #进入软件包存放目录

    tar zxvf libmcrypt-2.5.8.tar.gz  #解压

    cd libmcrypt-2.5.8  #进入安装目录

    ./configure  #配置

    make  #编译

    make install  #安装

    2、安装mhash

    cd /usr/local/src

    tar zxvf mhash-0.9.9.9.tar.gz

    cd mhash-0.9.9.9

    ./configure

    make

    make install

    3、安装mcrypt

    cd /usr/local/src

    tar zxvf mcrypt-2.6.8.tar.gz

    cd mcrypt-2.6.8

    ln -s   /usr/local/bin/libmcrypt_config   /usr/bin/libmcrypt_config  #添加软连接

    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH  #添加环境变量

    ./configure

    make

    make install

    三、重新编译php

    注意:

    tar zxf php-5.3.3.tar.gz
    cd php-5.3.3/ext/mcrypt/
    /usr/bin/phpize
    (这个命令有的话,就可以这样,若没有的话,只能下载php5.3.3源码(http://pan.baidu.com/s/1mifTbfE),进行./configure)
    ./configure --with-php-config=/usr/bin/php-config
    make
    make install
     
    echo 'extension=mcrypt.so' /etc/php.d/mcrypt.ini
    /etc/init.d/httpd reload
    php -m |grep 'mcrypt'
    编译安装:

    1、查看系统之前安装的php编译参数

    /usr/local/php/bin/php -i |grep configure  #查看php编译参数,记录下编译参数,后面会用到

    2、安装php

    cd /usr/local/src

    tar zxvf php-5.3.3.tar.gz

    cd php-5.3.3

    './configure' '--prefix=/usr/local/php' '--enable-mbstring=all' '--with-config-file-path=/usr/local/php/etc' '--with-zlib' '--with-MySQL=/usr/local/mysql-5.1.38/' '--with-gd' '--with-mysqli=/usr/local/mysql-5.1.38/bin/mysql_config' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-fpm' '--enable-soap' '--with-freetype-dir=/usr/lib64' '--with-iconv=/usr/local' '--with-curl' '--with-mcrypt'

    这里可以参考之前的已经安装完的./configure

    #在之前的编译参数后面增加'--with-mcrypt' 回车

    make  #编译

    make install  #安装

    四、测试mcrypt扩展是否已安装成功

    在网站目录下新建一个info.php测试页面,写上下面代码,保存

    <?php

    phpinfo();

    ?>

  • 相关阅读:
    用php做了下冒泡排序
    安装xampp无法设置默认时间的坑
    PHP的静态变量和引用函数
    jquery.cookie.js 用法
    PhpStorm的open in browser怎么修改端口和相对路径
    springmvc上传图片并显示图片--支持多图片上传
    Spring MVC中处理静态资源的多种方法
    超强、超详细Redis数据库入门教程(转载)
    推荐60个jQuery插件(转)
    [Spring MVC]
  • 原文地址:https://www.cnblogs.com/cbugs/p/6369790.html
Copyright © 2011-2022 走看看