phpMyAdmin error Cannot load mcrypt extension: problem and solution

phpMyAdmin error Cannot load mcrypt extension: problem and solution cover image
  1. Home
  2. PHP
  3. phpMyAdmin error Cannot load mcrypt extension: problem and solution

I was trying to install phpMyAdmin on a Windows 7 computer and thought it would be a walk in the park. After all, how wrong could I go with simple unpacking of the zip file to the document root?

Cannot load mcrypt extension error message in the phpMyAdmin login page

Though I was ‘partly’ right (the process was as easy as I had assumed), a “Cannot load mcrypt extension” error message greeted me when I loaded the phpMyAdmin login page in the web browser – see image below. Below is the solution to this problem.

Sponsored Links

The “Cannot load mcrypt extension” error is not because of phpMyAdmin, MySQL or Apache. It’s a PHP configuration issue and involves editing the php.ini file. This file is located in the folder in which you had installed PHP. This would be C:/PHP if you’ve followed my instructions on how to install PHP on Windows 7.

Load the extension to get rid of “Cannot load mcrypt extension” error message

The quickest way to solve this problem and get rid of the Cannot load mcrypt extension error message is to open php.ini in Notepad and load mcrypt.dll. Thus,

  1. Open php.ini in Notepad.
  2. Locate ;extension=php_mbstring.dll and ;extension=php_mcrypt.dll and remove the preceding semi-colons. (Thanks, tsauraik).
  3. Save the PHP configuration file.
  4. Since important settings have been changed, you would have to restart the web browser. For Apache, click on its icon in the Notification Area (System Tray) and choose Apache 2.2 -> Restart.

The “Cannot load mcrypt extension” error message would now be removed from the phpMyAdmin login page.

PHP phpMyAdmin Programming