Ubuntu 8.04 下安装mcrypt扩展

 

在Ubuntu下执行

sudo apt-get install libmcrypt4 php5-mcrypt

然后重启apache2服务

sudo /etc/init.d/apache2 restart

 

编辑php配置文件vim /etc/php5/cli/php.ini找到mcrypt并在下面添加红色行: 

[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
mcrypt.algorithms_dir=/etc/bash_completion.d/mcrypt

如果找不到,就把以上代码全部贴入/etc/php5/cli/php.ini即可

 

然后在任意一个php页面中输入以下代码:

<?php
phpinfo();
?>

运行后看到如下图,则配置正确

 

 

posted on 2013-01-24 14:25  hellofking  阅读(161)  评论(0编辑  收藏  举报

导航