虚拟化容器,大数据,DBA,中间件,监控。

PHP 加密扩展 Mcrypt 安装/配置

04 06月
作者:admin|分类:应用管理

安装

使用 --with-mcrypt[=DIR] 参数来编译 PHP 以启用本扩展。 DIR 是 mcrypt 的安装路径。 请确保编译 libmcrypt 的时候使用了 --disable-posix-threads 选项。

add a note add a note

User Contributed Notes 10 notes

up
42
Anonymous
1 year ago
Note, for Ubuntu, simply installing php5-mcrypt did not get mcrypt to work. You need to execute the following commands as root to enable it:

apt-get install php5-mcrypt
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
php5enmod mcrypt
service apache2 restart
up
14
Polichism
8 months ago
If you don't have a /etc/php5/conf.d directory, you can simply only do: php5enmod mcrypt

Should be working fine.
up
6
Tanner Williamson
8 months ago
On Ubuntu 14.04 LTS using php5-fpm with Nginx, I had to symlink the mcrypt.ini to the correct location, and then restart php5-fpm and nginx.
#ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/fpm/conf.d/mcrypt.ini
#service php5-fpm restart
#service nginx restart
up
3
biz at svstartuplab dot com
1 year ago
I needed to install mcrypt on Mac OS X Mavericks 10.9 for installing the Laravel 5 framework. I entered in the Terminal command line:

brew tap josegonzalez/homebrew-php
brew install php54 php54-mcrypt

This installed Mcrypt.  In Terminal type php -i to see a list of everything installed or for much better formatting and easier to read make a phpinfo.php page with this inside <?php phpinfo(); ?> 

More help with installing on OS X:
http://stackoverflow.com/questions/14595841/installing-mcrypt-extension-for-php-on-osx-mountain-lion
up
6
james dot mclean at gmail dot com
5 years ago
You can install Mcrypt from the PHP Source Tree as a module if you choose.

You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed, then do:

# cd php-5.x.x/ext/mcrypt
# phpize
# aclocal
# ./configure
# make && make install

Enable the module by adding: 'extension=mcrypt.so' to PHP.ini.

Done!

Very handy if you need to install a single module and you may have installed PHP via RPM, but don't wish to recompile your whole PHP install.
up
0
trenton at rainleader dot com
4 years ago
If using a Debian-based Linux system, you can run the following commands:

sudo apt-get install php5-mcrypt
sudo /etc/init.d/apache2 restart
up
-4
sobit dot akhmedov at gmail dot com
2 years ago
To install Mcrypt for PHP 5.3.x using Brew on Mac OS X, run the following command:

brew install php53-mcrypt
up
-14
Nancy H
2 years ago
To install php mcrypt you must install Libmcrypt first. Libmcrypt can be installed like this:

cd /usr/local/src
wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
cd /usr/local/src/libmcrypt-2.5.8
./configure --prefix=/usr/local
make
make install
up
-23
yazeed
1 year ago
As of 2009, to install php mcrypt you must install Libmcrypt first. Libmcrypt can be installed like this:

cd /usr/local/src
wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
cd /usr/local/src/libmcrypt-2.5.8
./configure --prefix=/usr/local  --disable-posix-threads --enable-dynamic-loading
make
make install
up
-23
OpenSourceVictim
5 years ago
Mcrypt.dll should be included in the WINDOWS installer of PHP.
Or in the WINDOWS installer of phpmyadmin.
浏览2164 评论0
返回
目录
返回
首页
git - 简易指南 php文件访问报错:use mysqli or PDO instead in