First of all a disclaimer: I am relatively inexperienced at using linux commands.

I have a CentOS5 server running php 5.2.9 on a 1and1.com VPS.

I want to install Magento, but in order to do so I need the mcrypt extension.

I attempted to install using

yum install mhash
yum install mcrypt
yum install php-mhash
yum install php-mcrypt

BUT it didn't work. Now I get:

# php -v
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
[B]These options need to match[/B]
 in Unknown on line 0
PHP Warning:  PHP Startup: mhash: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
[B]These options need to match[/B]
 in Unknown on line 0
PHP 5.2.9 (cli) (built: Jul  8 2009 05:59:13) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Then I attempted to follow the directions here:

http://www.notesbit.com/index.php/web-mysql/web-scripts/how-to-install-mcrypt-in-linux-cent-os-and-recompile-php/

But then I get this (I don't know what it means):

# ./configure –disable-posix-threads
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: –disable-posix-threads
checking build system type... Invalid configuration `–disable-posix-threads': machine `–disable-posix' not recognized
configure: error: /bin/sh ./config.sub –disable-posix-threads failed

I just want to install Magento!

Please help me get this mcrypt thing installed.

    If you can, I'd ask 1and1 to reset your server, and install PHP with the mcrypt library. THat's the easiest.

    We use CentOS at work; however, because we use Rackspace and our support contract(s), we make Rackspace do all PHP work that we can. So this would go under our support contract. 1and1 offers 24/7 phone and email support. You're probably better off asking them for help since they know their system(s) better than we would.

      Unfortunately it's not as simple as resetting the server as there are custom applications that have not been tested under newer versions of php.

      Going past php-5.2.9 isn't possible for me at this time.

        I didn't say upgrade your php, I said get them to recompile PHP with mcrypt installed....

          That would be great. But they do not offer that service.

            You can have a try with
            php function [man]dl/man
            Loads the PHP extension given by the parameter

            But probably this function can have been disabled by your host.
            And so it is of no use.

              halojoy,

              Where would I type this?

              What would the exact command be to install mcrypt?

                The dl() should be avoided in order to keep your Magento future-proof in upgrades.

                Your best bet is to either:

                1. Start over with a fresh install of CentOS 5 and try running "yum install php-mcrypt php-mhash" without modifying any yum repo files.

                2. Use the CentOS 5 releases of PHP which is PHP 5.1.6-23.2.e15_3 (for Cent OS 5.4)

                The other option is to drop 1and1 and look into using the Rackspace Cloud servers which might cost you less, and allow you to expand at any time (as Magento can be a bit of a resource hog). Anyway, with their cloud servers, you can start with a fresh Cent OS 5.4 install and properly install php with mcrypt and mhash in one line:

                yum install php php-mcrypt php-mhash php-tidy php-soap php-xml php-xmlrpc php-bcmath php-cli php-gd php-imap php-mbsring php-pdo php-mysql php-pgsql

                If 1and1 isn't allowing you to completely start fresh with cleaning your VPS, I wonder what their 24/7 tech support is really for? And if they're not willing to support you in getting this fixed, I again question why they have tech support. It's there with every VPS they currently offer (including a 90-day moneyback guarantee).

                  Your configure should have two hyphens ...

                  ./configure --disable-posix-threads

                    Write a Reply...