Install mcrypt extension module note_php instance in PHP in Linux

Source: Internet
Author: User
Tags mcrypt zts
This article describes how to install the mcrypt extension module in PHP in Linux. This article also describes how to install Libmcrypt and mhash. If you need it, refer to the following system environment: centOS6.3.
APACHE: httpd-2.4.2
PHP: php-5.3.21

1. Install mcrypt

1. Download The Libmcrypt, mhash, and mcrypt installation packages.

The Code is as follows:


Libmcrypt-2.5.8.tar.gz
# Wget http://sourceforge.net/project/showfiles.php? Group_id = 87941 & package_id = 91774 & release_id = 487459
Mhash-0.9.9.tar.gz
# Wget http://sourceforge.net/project/showfiles.php? Group_id = 4286 & package_id = 4300 & release_id = 645636
Mcrypt-2.6.8.tar.gz
# Wget http://sourceforge.net/project/showfiles.php? Group_id = 87941 & package_id = 91948 & release_id = 642101

2. Install Libmcrypt first

The Code is as follows:


# Tar-zxvf libmcrypt-2.5.8.tar.gz
# Cd libmcrypt-2.5.8
#/Usr/local/php5/bin/phpize # dynamically compile the php module so that it can be compiled using configure.
#./Configure
# Make
# Make install # libmbench is installed in/usr/local by default.

3. Install mhash

The Code is as follows:


# Tar-zxvf mhash-0.9.9.9.tar.gz
# Cd mhash-0.9.9.9
#/Usr/local/php5/bin/phpize
#./Configure
# Make
# Make install

4. Install mcrypt

The Code is as follows:


# Tar-zxvf mcrypt-2.6.8.tar.gz
# Cd mcrypt-2.6.8
#/Usr/local/php5/bin/phpize
#./Configure -- with-php-config =/usr/local/php5/bin/php-config
# Make
# Make install


After installation, follow the prompts after compilation and installation.
The mcrypt. so module is saved in the/usr/local/php5/lib/php/extensions/no-debug-zts-20090626/directory by default.

5. Load the module to php

The Code is as follows:


# Vi/usr/local/php5/lib/php. ini


Add the following lines:

The Code is as follows:


Extension = "/usr/local/php5/lib/php/extension/ no-debug-zts-20090626/mcrypt. so"


Restart apache:

The Code is as follows:


/Usr/local/apache2/bin/apachectl restart

6. added the phpinfo function to the test page.

Add info. php to/usr/local/apache2/htdocs/to test whether the php module is loaded.

The Code is as follows:

# Vi/usr/local/apache2/htdocs/info. php
---------------
<? Php
Echo phpinfo ();
?>
---------------


Check whether port 80 is enabled

The Code is as follows:


# Lsof-I: 80


Enter http: // localhost/info. php In the browser
The following test page is displayed. The mcrypt. so module is successfully loaded under PHP.

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.