Home >Backend Development >PHP Tutorial >Ubuntu cannot load mcrypt (external link, English) extension_PHP tutorial
Problem Solved
1. Install apt-get install php5-mcrypt
2. Edit the php configuration file vim /etc/php5/cgi/php.ini to find mcrypt and add the red line below:
[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. After the addition is completed, be sure to restart 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
Author "Xiaobai loves rookie"