Install php mcrypt extension in ubuntu

Source: Internet
Author: User
Tags install php ini mcrypt

Error screenshot

1. Install the Mcrypt package

The code is as follows: Copy code

Php5-mcrypt libmcrypt4 libmcrypt-dev

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

Problem

Unable to load mcrypt

Solution

Edit the php configuration file vim/etc/php5/cgi/php. ini, find mcrypt, and add a 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. Restart fast-cgi after adding:
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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.