Linux下php5.3.3安裝mcrypt擴充

來源:互聯網
上載者:User

標籤:org   efi   參數   soap   擴充   目錄   源碼   make   net   

具體操作:

一、下載軟體包

1、下載php(版本要與系統安裝的一致)

http://pan.baidu.com/s/1mifTbfE

2、下載libmcrypt(安裝mcrypt需要此軟體包)

http://pan.baidu.com/s/1mifTbfE

3、下載mhash(安裝mcrypt需要此軟體包)

http://pan.baidu.com/s/1mifTbfE

4、下載mcrypt

http://pan.baidu.com/s/1mifTbfE

或者:

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1430725959&use_mirror=ncu wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F&ts=1430726021&use_mirror=ncu wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F&ts=1430726218&use_mirror=ncuwget http://museum.php.net/php5/php-5.3.3.tar.gz

以上軟體包下載之後,上傳到/usr/local/src目錄

二、安裝軟體包

1、安裝libmcrypt

cd /usr/local/src  #進入軟體包存放目錄

tar zxvf libmcrypt-2.5.8.tar.gz  #解壓

cd libmcrypt-2.5.8  #進入安裝目錄

./configure  #配置

make  #編譯

make install  #安裝

2、安裝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、安裝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

三、重新編譯php

注意:

tar zxf php-5.3.3.tar.gzcd php-5.3.3/ext/mcrypt//usr/bin/phpize(這個命令有的話,就可以這樣,若沒有的話,只能下載php5.3.3源碼(http://pan.baidu.com/s/1mifTbfE),進行./configure)./configure --with-php-config=/usr/bin/php-configmakemake install echo ‘extension=mcrypt.so‘ > /etc/php.d/mcrypt.ini/etc/init.d/httpd reloadphp -m |grep ‘mcrypt‘編譯安裝:

1、查看系統之前安裝的php編譯參數

/usr/local/php/bin/php -i |grep configure  #查看php編譯參數,記錄下編譯參數,後面會用到

2、安裝php

cd /usr/local/src

tar zxvf php-5.3.3.tar.gz

cd php-5.3.3

‘./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‘

這裡可以參考之前的已經安裝完的./configure

#在之前的編譯參數後面增加‘--with-mcrypt‘ 斷行符號

make  #編譯

make install  #安裝

四、測試mcrypt擴充是否已安裝成功

在網站目錄下建立一個info.php測試頁面,寫上下面代碼,儲存

<?php

phpinfo();

?>

Linux下php5.3.3安裝mcrypt擴充

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.