Chinaunix首页 | 论坛 | 博客
  • 博客访问: 494599
  • 博文数量: 112
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 662
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-20 07:22
个人简介

一步一个脚印

文章分类

全部博文(112)

文章存档

2019年(2)

2017年(2)

2016年(2)

2015年(6)

2014年(35)

2013年(65)

分类: LINUX

2013-11-21 14:08:58

为yum方式安装的php添加mcrypt扩展

 

安装mcrypt

yum install libmcrypt libmcrypt-devel mcrypt mhash

 

安装phpmcrypt扩展(动态加载编译)

 

下载php的源码编译包php-5.3.3.tar.gz

tar xzvf php-5.3.3.tar.gz

cd php-5.3.3/ext/mcrypt/

 

whereis phpize  //为了确定phpize存在

phpize: /usr/bin/phpize /usr/share/man/man1/phpize.1.gz

 

phpize

Configuring for:

PHP Api Version:         20090626

Zend Module Api No:      20090626

Zend Extension Api No:   220090626

执行完后,会发现当前目录下多了一些configure文件,最后执行php-config命令就基本完成了

 

whereis php-config  //确保/usr/bin/php-config是存在的

php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz

 

./configure --with-php-config=/usr/bin/php-config

如果遇到以下错误,请先安装gcc,命令yum install gcc

configure: error: no acceptable C compiler found in $PATH

 

直到不报错,出现:config.status: creating config.h,执行以下命令

make && make install

 

最后的最后,会提示你如下,说明你大功告成了

Installing shared extensions:     /usr/lib64/php/modules/

 

顺便检查下/usr/lib64/php/modules/里的mrcypt.so扩展是否已经创建成功

 

vi php.ini  //添加一行

extension=mcrypt.so

 

apachectl restart  //重启Apache

 

查阅phpinfomcrypt模块扩展是不是加载了?

阅读(2230) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~