How to Fix “PHP Warning: PHP Startup: mcrypt: Unable to initialize module” on Centos 5


I found this error message after upgrading PHP 5.1.6 to 5.2.14

# 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
 These options need to match
 in Unknown on line 0
 PHP 5.2.14 (cli) (built: Aug 12 2010 16:03:48)
 Copyright (c) 1997-2010 The PHP Group
 Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

The problem happens when there is a mismatch version of php-mcrypt module with php installed in the server. You can check the version using this command line:

# yum list installed | grep php

 php-mbstring.x86_64                        installed
 php-mcrypt.x86_64                    <strong>5.1.6</strong>-15.el5.centos.1        installed
 php-mysql.x86_64                             installed

To fix this error, we have to update php-mcrypt module:

# yum update php-mcrypt


  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1821 t18lI6nskgVCTj21ob7h15vTCwToMfe51FmZEIG3E-HrcGpqOohnIXbg85G_TkE8 e51ca04da75cc471f0c95052961349359cef7042&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

Leave a Reply

Your email address will not be published. Required fields are marked *