第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > linux mcrypt扩展 Linux下php安装mcrypt扩展-Go语言中文社区

linux mcrypt扩展 Linux下php安装mcrypt扩展-Go语言中文社区

时间:2019-08-28 15:53:48

相关推荐

linux mcrypt扩展 Linux下php安装mcrypt扩展-Go语言中文社区

说明:

操作系统:CentOS 5.x 64位

已安装php版本:php-5.4.4

已安装php路径:/usr/local/php

实现目的:

在不影响网站访问的情况下,重新编译php,增加对mcrypt扩展的支持

具体操作:

一、下载软件包

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

/php5/php-5.4.4.tar.gz

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

http://nchc./project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

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

/files/mhash-0.9.9.9.tar.gz

4、下载mcrypt

/files/mcrypt-2.6.8.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

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

系统运维温馨提醒:qihang01原创内容 版权所有,转载请注明出处及原文链接

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

2、安装php

cd /usr/local/src

tar zxvf php-5.4.4.tar.gz

cd php-5.4.4

'./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'

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

make#编译

make install#安装

/usr/local/src/php-5.4.4/sapi/fpm/init.d.php-fpm reload#重新加载php-fpm

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

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

phpinfo();

?>

在浏览器中打开info.php会看到如下的信息

说明mcrypt扩展已经安装成功

至此,Linux下php安装mcrypt扩展完成。

/archives/7421.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。