Linux under the PHP installation mcrypt extension ____linux

Source: Internet
Author: User
Tags fpm install php mcrypt php compiler

Description:

Operating system: CentOS 5.x 64-bit

Installed PHP Version: php-5.4.4

Installed PHP Path:/usr/local/php

to achieve the purpose:

Recompile PHP without affecting site access, increasing support for mcrypt extensions

Specific actions:

First, download the package

1, download PHP (version to be consistent with the installation of the system)

Http://museum.php.net/php5/php-5.4.4.tar.gz

2, download libmcrypt (install MCrypt need this package)

Http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

3, download Mhash (install MCrypt need this package)

Https://acelnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz

4, Download MCrypt

Https://lcmp.googlecode.com/files/mcrypt-2.6.8.tar.gz

After downloading the above packages, upload them to the/USR/LOCAL/SRC directory

Second, install the package

1. Installation Libmcrypt

CD/USR/LOCAL/SRC #进入软件包存放目录

Tar zxvf libmcrypt-2.5.8.tar.gz #解压

CD libmcrypt-2.5.8 #进入安装目录

./configure #配置

Make #编译

Make install #安装

2. Installation Mhash

Cd/usr/local/src

Tar zxvf mhash-0.9.9.9.tar.gz

CD mhash-0.9.9.9

./configure

Make

Make install

3. Installation MCrypt

Cd/usr/local/src

Tar zxvf mcrypt-2.6.8.tar.gz

CD mcrypt-2.6.8

Ln-s/usr/local/bin/libmcrypt_config/usr/bin/libmcrypt_config #添加软连接

Export ld_library_path=/usr/local/lib: $LD _library_path #添加环境变量

./configure

Make

Make install

third, recompile PHP

1, view the system installed before the PHP compiler parameters

System Yun-wei www.osyunwei.com warm reminder: qihang01 original content copyright, reproduced please indicate the source and the original link

/usr/local/php/bin/php-i |grep Configure #查看php编译参数, record the compilation parameters, and use the following

2. Install PHP

Cd/usr/local/src

Tar zxvf php-5.4.4.tar.gz

CD php-5.4.4

'./configure '--prefix=/usr/local/php '--enable-mbstring=all '--with-config-file-path=/usr/local/php/etc ' With-zlib '--with-mysql=/usr/local/mysql-5.1.38/'--with-gd '--with-mysqli=/usr/local/mysql-5.1.38/bin/mysql_ Config '--with-jpeg-dir=/usr '--with-png-dir=/usr '--enable-fpm '--enable-soap '--with-freetype-dir=/usr/ Lib64 '--with-iconv=/usr/local '--with-curl '--with-mcrypt '

#在之前的编译参数后面增加 '--with-mcrypt ' carriage return

Make #编译

Make install #安装

/USR/LOCAL/SRC/PHP-5.4.4/SAPI/FPM/INIT.D.PHP-FPM Reload #重新加载php-fpm

test whether the MCrypt extension has been installed successfully

Create a new info.php test page in the site directory, write the following code, and save

<?php

Phpinfo ();

?>

Opening info.php in the browser will see the following information

Description mcrypt extension has been installed successfully

at this point, Linux under the PHP installation mcrypt extension completed. » This article link: http://www.osyunwei.com/archives/7421.html» subscribe to this site: http://www.osyunwei.com/feed» reprint Please specify the Source: System Operation Dimension»lin UX under PHP installation mcrypt extension http://www.osyunwei.com/archives/7421.html

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.