在php上安裝mcrypt、bcmath和openssl擴展(銀聯業務須要)

一、 在php上安裝mcrypt擴展  php

1.1 編譯安裝libmcrypt  apache

# tar zxvf libmcrypt-2.5.8.tar.gz  spa

# cd libmcrypt-2.5.8  rest

# ./configure --prefix=/home/work/local/libmcrypt  ssl

# make  && make installopenssl

1.2 編譯安裝mhash(mcrypt依賴mhash)  hash

# tar jxvf mhash-0.9.9.9.tar.bz2  it

# cd mhash-0.9.9.9  io

# ./configure --prefix=/home/work/local/mhash  編譯

# make  && make install

1.3 編譯安裝php的mcrypt擴展  

# cd <php-src>/ext/mcrypt  

# /home/work/local/php/bin/phpize  

# 配置編譯環境  

export LD_LIBRARY_PATH=/home/work/local/libmcrypt/lib:/home/work/local/mhash/lib  

export LDFLAGS="-L/home/work/local/mhash/lib/ -I/home/work/local/mhash/include/"  

export CFLAGS="-I/home/work/local/libmcrypt/include/"  

# ./configure --with-mcrypt=/home/work/local/libmcrypt --with-php-config=/home/work/local/php/bin/php-config  

# make && make install  

/* 在 php.ini 中添加 extension=mcrypt.so*/  

# echo "extension=mcrypt.so" >> /home/work/local/php/lib/php.ini  

2 安裝bcmath擴展  

# cd <php-src>/ext/bcmath  

# /home/work/local/php/bin/phpize  

# ./configure --with-php-config=/home/work/local/php/bin/php-config  

# make && make install  

/* 在 php.ini 中添加 extension=bcmath.so*/  

# echo "extension=bcmath.so" >> /home/work/local/php/lib/php.ini  

3 安裝openssl擴展  

# cd <php-src>/ext/openssl  

# mv config0.m4 config.m4  

# /home/work/local/php/bin/phpize  

# ./configure --with-openssl --with-php-config=/home/work/local/php/bin/php-config  

# make && make install  

# echo "extension=openssl.so" >> /home/work/local/php/lib/php.ini  

4 重啓apache  

# /home/work/local/apache/bin/apachectl restart  

相關文章
相關標籤/搜索