安装

» PECL 扩展未与 PHP 捆绑。

安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。更多信息如新的发行版本、下载、源文件、 维护人员信息及变更日志等,都在此处: » https://pecl.php.net/package/mcrypt.

User Contributed Notes

Polichism 02-Oct-2014 06:43
If you don't have a /etc/php5/conf.d directory, you can simply only do: php5enmod mcrypt

Should be working fine.
Tanner Williamson 01-Oct-2014 05:56
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
biz at svstartuplab dot com 31-Mar-2014 11:20
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
Anonymous 12-Mar-2014 03:37
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
trenton at rainleader dot com 03-Dec-2010 08:22
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
james dot mclean at gmail dot com 12-Oct-2009 09:23
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.
PHP8中文手册 站长在线 整理 版权归PHP文档组所有