You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04.3 LTS安装phpMyAdmin时phpenmod mcrypt报错求解决方案

Fixing "WARNING: Module mcrypt ini file doesn't exist" for PHP 7.2 on Ubuntu 16.04.3 LTS

Hey there, let's tackle this mcrypt issue you're facing while setting up phpMyAdmin. The error pops up because mcrypt was deprecated starting in PHP 7.2 and isn't included by default in the standard packages for Ubuntu 16.04. Here's how to resolve it properly:

  • First, install the PHP 7.2 mcrypt extension package. Run these commands in your terminal:

    sudo apt-get update
    sudo apt-get install php7.2-mcrypt
    

    This will pull down the necessary files for the extension.

  • If the error still persists after installation, it means the ini file for mcrypt wasn't automatically created. Let's manually set it up:

    1. First, confirm the location of the mcrypt.so file (PHP 7.2's extension directory typically uses the 20170718 suffix):

      find /usr/lib/php/20170718/ -name mcrypt.so
      

      If this path doesn't exist, replace 20170718 with the actual directory name you see under /usr/lib/php/.

    2. Create the mcrypt ini file in the mods-available directory:

      sudo nano /etc/php/7.2/mods-available/mcrypt.ini
      

      Inside the file, add this single line:

      extension=mcrypt.so
      

      Save and exit the editor (for nano, press Ctrl+O, hit enter, then Ctrl+X).

  • Now run the phpenmod command again—it should work without errors:

    sudo phpenmod mcrypt
    
  • Finally, restart Apache to apply the changes:

    sudo systemctl restart apache2
    

A quick note: Since mcrypt is deprecated in PHP 7.2 and later, consider exploring alternatives like OpenSSL for future projects. But for phpMyAdmin compatibility on your current setup, this fix will get you up and running.

内容的提问来源于stack exchange,提问作者Fil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:37:58