dscdttg4389 2017-02-04 21:53
浏览 170
已采纳

服务器上未启用PHP扩展名mcrypt

I'm modifying a plugin in wordpress. The plugin is "RegistrationMagic", when I inhaled it and went to the screen it appeared the following message "PHP extension mcrypt is not enabled on server".

I tried to follow the hint of that question "https://askubuntu.com/questions/460837/mcrypt-extension-is-missing-in-14-04-server-for-mysql"

But when I get to that part:

Sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini
Sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini

Can not find conf.d file

Someone can help me: I already tried to reinstall php5 but it did not work either.

EDIT

When I do a locate in myscript.so it returns this below:

$locate mcrypt.so

/usr/lib/libmcrypt.so.4
/usr/lib/libmcrypt.so.4.4.8
/usr/lib/php5/20121212/mcrypt.so
  • 写回答

2条回答 默认 最新

  • dongzuan4860 2017-02-04 21:59
    关注

    PHP doesn't compile mcrypt by default. you first have to have mcrypt installed

    You need to compile PHP with the --with-mcrypt[=DIR] parameter to enable this extension. DIR is the mcrypt install directory. Make sure you compile libmcrypt with the option --disable-posix-threads

    an example for enabling it on ubuntu, in terminal run the following:

    apt-get install php5-mcrypt
    mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
    php5enmod mcrypt
    service apache2 restart
    

    here is an article on the php5enmod command: https://lornajane.net/posts/2012/managing-php-5-4-extensions-on-ubuntu

    to Fix a missing mcrypt ini:

    sudo updatedb 
    locate mcrypt.ini
    

    Should show it located at /etc/php5/mods-available

    locate mcrypt.so
    

    Edit mcrypt.ini and change extension to match the path to mcrypt.so, example:

    extension=/usr/lib/php5/20121212/mcrypt.so
    

    Now this:

    sudo php5enmod mcrypt
    

    Verify that new files exists here (they should be auto created from the issue above)

    ls -al /etc/php5/cli/conf.d/20-mcrypt.ini
    ls -al /etc/php5/apache2/conf.d/20-mcrypt.ini
    

    Otherwise do the following

    Create symbol links now

    sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini
    sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
    

    Restart Apache

    sudo service apache2 restart
    

    Restart php5 or php5-fpm

    sudo service php5 restart
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,