CentOS6.5 Installing PHP (5.3.3) extension mcrypt

Source: Internet
Author: User
Tags mcrypt phpinfo

Install PHP

1.yum-y Install PHP php-fpm

(1), confirm that your Linux is not installed MCrypt library, if installed, skip the installation steps

# Yum List Installed|grep MCrypt

libmcrypt.x86_64 2.5.8-9.el6 @epel

libmcrypt-devel.x86_64 2.5.8-9.el6 @epel

mcrypt.x86_64 2.6.8-10.el6 @epel


The above display has been installed, if not, the following two ways to install

(method i) Yum commands lazy people to install

Yum install Libmcrypt libmcrypt-devel mcrypt Mhash

After execution, you will be presented with a library of upcoming installations, which you can x86_64 or i386, such as Yum install libmcrypt.x86_64 (if the Yum command cannot connect to the repository, check your/etc/yum.repos.d/ The file is correct, and your/etc/host is not up to the domain name inside)

(method II) Source code compilation installation, go to http://www.sourceforge.net download Libmcrypt,mhash,mcrypt installation package
Libmcrypt (libmcrypt-2.5.8.tar.gz):
MCrypt (mcrypt-2.6.8.tar.gz):
Mhash (mhash-0.9.9.9.tar.gz):
2. Install Libmcrypt First

#tar-ZXVF libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8#./configure
#make #make Install Instructions: Libmcript installed by default in/usr/local

3. Installing Mhash

#tar-ZXVF mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9#./configure
#make #make Install

4. Installing MCrypt

#tar-ZXVF mcrypt-2.6.8.tar.gz
#cd Mcrypt-2.6.8#ld_library_path=/usr/local/lib./configure
#make #make Install

Finally, check whether the installation is successful

(2), install PHP mcrypt extension (dynamic load compilation)

Download the mcrypt extension under PHP or download the full installation package for PHP directly

http://cn.php.net/releases/ Web page to find the PHP version of their own server, after downloading tar decompression (my is php5.3.3)

Go to Ext/mcrypt folder

# CD php-5.3.3/ext/mcrypt/

Execute the phpize command (Phpize is used to extend the PHP extension module, through the phpize can build PHP plug-in module, if not? Yum Install Php53-devel contains, or other methods)

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" Border:none; "/>

[Email protected]*_* 14:48 mcrypt]# whereis phpize//In order to determine phpize presence
Phpize:/usr/bin/phpize/usr/share/man/man1/phpize.1.gz
[Email protected]*_* 14:48 mcrypt]# phpize
Configuring for:
PHP API Version:20090626zend Module API no:20090626zend Extension API no:220090626

After execution, you will find that the current directory is more than a few configure files, the final execution of the Php-config command is basically completed

Execute the following command to ensure that your/usr/bin/php-config is present

# Whereis Php-config
Php-config:/usr/bin/php-config/usr/share/man/man1/php-config.1.gz
#./configure--with-php-config=/usr/bin/php-config

Until you do not error, appear: Config.status:creating config.h, execute the following command

# Make && make install

At the end of the final, you will be prompted as follows, stating that you are done

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

By the way, check if the mrcypt.so extension in/usr/lib64/php/modules/has been created successfully.


Then the thing is simple, add the extension.

Method One, add a extension=mcrypt.so to your php.ini

Method Two, create a Mrcypt.ini file on the line, inside write extension=mcrypt.so

# CD/ETC/PHP.D
# echo ' extension=mcrypt.so ' > Mcrypt.ini


Finally check whether the extension was added successfully

Restart PHP, check to see if the Phpinfo,mcrypt module extension is loaded?

#/etc/init.d/php-fpm Restart

stopping php-fpm: [OK]

Starting PHP-FPM:


Create php files in your PHP publishing directory


# cat/home/default/ganinfo/index2.php

<?php phpinfo ();?>


Access http://ip/index2.php , you will see the configuration of your PHP

650) this.width=650; "src=" Http://pic002.cnblogs.com/images/2012/185616/2012091215275516.jpg "alt=" 2012091215275516.jpg "/>

Reference Link: http://www.cnblogs.com/huangzhen/archive/2012/09/12/2681861.html

CentOS6.5 Installing PHP (5.3.3) extension mcrypt

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.