linux php install mcrypt extension

(Mcrypt need to install this package) # Download libmcrypt
# wget can be downloaded by using the following path [2.5.8] version is too high
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt- 2.5.7.tar.gz

# Download mhash (mcrypt need to install this package)
https://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download

#下载mcrypt
https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download

(1, mounted libmcrypt)
# extracting
the tar-2.5.7.tar.gz -zxvf libmcrypt
# directory into the
CD-libmcrypt 2.5.7
# compiler (default installed / usr / local / lib /)
./configure --prefix = / usr / local / lib / libmcrypt
# perform the installation
make && make install

(2, mounting the mhash)
# extracting
the tar-0.9.9.9.tar.gz -zxvf the mhash
# directory into the
CD-0.9.9.9 the mhash
# compiler
./configrue --prefix = / usr / local / lib / the mhash
# execute the installation
make && make install

(3, install mcrypt)
# extract the
tar -zxvf mcrypt-2.6.8.tar.gz
# enter the directory
cd mcrypt-2.6.8
[election do (do would be to see how?)]
Export LD_LIBRARY_PATH = / usr / local / libmcrypt / lib: / usr / local / the mhash / lib
Export LDFLAGS = "- L / usr / local / the mhash / -I lib / usr / local / the mhash / the include /"
Export the CFLAGS = "- the I / usr / local / mhash / include / "
[end]
# compiler
./configure --prefix = / usr / local / lib / mcrypt-libmcrypt --with-prefix = / usr / local / lib / libmcrypt
# perform the installation
make && make install

(4、添加 mcrypt 扩展)
cd /data/soft/php-5.5.38/ext/mcrypt
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-mcrypt=/usr/local/lib/libmcrypt
make && make install

(5、修改 php.ini)
extension_dir="/usr/local/php/lib/php/extensions/no-debug-zts-20121212/"
extension=mcrypt.so

Guess you like

Origin blog.csdn.net/xianhenyuan/article/details/92795035