Install php-mcrypt on CentOS 6

前端 未结 18 2196
感动是毒
感动是毒 2020-12-02 13:15

I have been trying to install php-mcrypt for a while now. Everytime I get the \"No package php-mcrypt available.\" returned to me. Here\'s what I\'ve tried:

         


        
相关标签:
18条回答
  • 2020-12-02 13:22

    If php_mcrypt installed on 64bit but reported missing by an installer, check the extension path:

    vi /etc/php.d/mcrypt.ini

    ; Enable mcrypt extension module
    ;extension=module.so
    extension=/usr/lib64/php/modules/mcrypt.so
    
    0 讨论(0)
  • 2020-12-02 13:24

    First find out your PHP version. In my case 5.6.

    php --version

    PHP 5.6.27 (cli) (built: Oct 15 2016 21:31:59) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

    Then:

    sudo yum search mcrypt

    And choose the best one for your version from the list, I used php56w-mcrypt.

      $ sudo yum search mcrypt
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
    
      ..... output truncated ....
    
    libmcrypt-devel.i686 : Development libraries and headers for libmcrypt
    libmcrypt-devel.x86_64 : Development libraries and headers for libmcrypt
    libtomcrypt-devel.i686 : Development files for libtomcrypt
    libtomcrypt-devel.x86_64 : Development files for libtomcrypt
    libtomcrypt-doc.noarch : Documentation files for libtomcrypt
    php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    php55w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    
    # either of these are fine:
    php56-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    php56w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    
    php70-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    php71-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
    libmcrypt.i686 : Encryption algorithms library
    libmcrypt.x86_64 : Encryption algorithms library
    libtomcrypt.i686 : A comprehensive, portable cryptographic toolkit
    libtomcrypt.x86_64 : A comprehensive, portable cryptographic toolkit
    mcrypt.x86_64 : Replacement for crypt()
    ```
    

    Finally:

    sudo service httpd restart

    0 讨论(0)
  • 2020-12-02 13:25

    To install mcrypt from http://namhuy.net/641/centos-6-install-mcrypt-for-phpmyadmin.html

    i386

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    

    x86_64

    http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    

    then just use yum command to install the mcrypt package

    yum install php-mcrypt
    
    0 讨论(0)
  • 2020-12-02 13:25

    If you want to recompile PHP with mcrypt enable.

    1. Insatll mcrypt. libmcrypt-devel is from Third Party Repositories EPEL, so you should:

    yum --enablerepo=extras install epel-release
    yum install libmcrypt-devel
    

    2. Append --with-mcrypt to your ./configure arguments:

    ./configure --with-mcrypt
    

    3. Build and install:

    make & make install
    
    0 讨论(0)
  • 2020-12-02 13:27

    installing php-mcrypt from Repoforge worked for me perfectly. Just add Repoforge from http://repoforge.org/ and simply run yum install php-mcrypt.

    0 讨论(0)
  • 2020-12-02 13:28
    yum install php-mcrypt.x86_64
    

    worked for me instead of

    yum install php-mcrypt
    
    0 讨论(0)
提交回复
热议问题