Fatal error call to undefined function mcrypt_module_open() in Magento



I have transfers the website from the development to production environment every thing is working fine except the chekout, when I clicked on the checkout buttons then it is displaying the blank page I came across this error: Fatal error: Call to undefined function mcrypt_module_open() in /path/to/Magento/site/lib/Varien/Crypt/Mcrypt.php on line 63, for the confirmation that is php-mcrypt is installed or not on the server I have created a PHP file with the below code
<?php
phpinfo();
?>

and uploaded that file on the root where Magento is installed on the server then I found that php-mcrypt was not installed on the server. Then I understand that the problem was coming due to that extension. It is very simple to install the php-mcrypt on the server.

1. If you are using a Debian-based Linux system, you can run the following commands:

sudo apt-get install php5-mcrypt
sudo /etc/init.d/apache2 restart

Hope this will be helpful to someone.