ubuntu安装php mcrypt扩展的步骤

作者:袖梨 2022-06-30

错误截图

1、安装 Mcrypt 包

 代码如下 复制代码

php5-mcrypt libmcrypt4 libmcrypt-dev

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart

问题

无法加载 mcrypt

解决办法

编辑php配置文件vim /etc/php5/cgi/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
3.添加完成后注意要重启fast-cgi:
root@Ubuntu:/# killall -9 php-cgi
root@Ubuntu:/# /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 20 -u nginx -g nginx -f /usr/bin/php5-cgi

 

相关文章

精彩推荐