Unable to initialize module

Whilst trying to run a cron task, I get the following error:

Output from command /usr/bin/php /home/domain/public_html/newsletters/admin/processqueue.php ..

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 Invalid Request

The PHP version is 5.2.14, and all has been recently install from standard repositories.

I also appreciate that the cron command my be incorrect.

Status: 
Active

Comments

This could be due to a PHP / module version mismatch.

What is the output from the following command on your system :

rpm -qa | grep php

Howdy -- that error suggests that the PHP module being loaded was compiled for a different PHP version than what's available on your server.

What output do you receive if you type:

rpm -qa | grep php

We get:

-bash-3.2# rpm -qa | grep php php-ioncube-loader-3.3.20-3.el5.art

php-pdo-5.2.14-2.el5.art

php-cli-5.2.14-2.el5.art

php-gd-5.2.14-2.el5.art

php-mysql-5.2.14-2.el5.art

php-snmp-5.2.14-2.el5.art

php-zend-optimizer-3.3.9-2.el5.art

php-5.2.14-2.el5.art

php-odbc-5.2.14-2.el5.art

php-mbstring-5.2.14-2.el5.art

php-imap-5.2.14-2.el5.art

wbm-php-pear-1.5-1

php-common-5.2.14-2.el5.art

php-pgsql-5.2.14-2.el5.art

php-xmlrpc-5.2.14-2.el5.art

php-devel-5.2.14-2.el5.art

php-pear-1.7.2-2.el5.art

php-mcrypt-5.1.6-15.el5.centos.1

Looks like mcrypt is out, however, as all was installed at the same time, how can they be out of sync?

Removing and reinstalling gets the same version

Not sure .. but you can fix it with yum install php-mcrypt

Actually, where are those .art PHP packages come from? Did you add an additional RPM repository for PHP packages?

I would be interested to know what is in /etc/yum.repos.d on your system.

CentOS-Base.repo CentOS-Media.repo virtualmin.repo webmin.repo

I have installed 2 packages that are not in the standard repo's, such as ioncube, but I am sure that was 'direct', not via yum.

Did you install some PHP packages manually?

Also, do you require a specific PHP version, like 5.2.x ?

I do not think I did, however, would installing something like ionloader have added in some dependencies?

I did a complete reload of the server a fe weeks ago to clean it up.

The only other package that comes to mind, that I installed, was imagemagic.

I am not running anything that specifically needs 5.2.x, that I am aware of.

What does the following output for you :

yum list | grep vmbleed

-bash-3.2# yum list | grep vmbleed

php-bcmath.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-dba.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-debuginfo.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-embedded.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-ldap.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-mcrypt.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-mhash.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-mssql.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-ncurses.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-pspell.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-soap.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-tidy.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed

php-xml.x86_64 5.2.14-1.el5.vmbleed virtualmin-bleed -bash-3.2#

Ok, in that case the command you want is :

yum install php-5.2.14-1.el5.vmbleed

aarrrggghhh

Package matching php-5.2.14-1.el5.vmbleed.x86_64 already installed. Checking for update.

Nothing to do

Damn, it looks like yum doesn't like that version because it thinks it is newer than the current one..

Can you tolerate a short down-time for your site during which PHP won't work? If so, you could remove all the PHP packages with a command like :

rpm -e --nodeps php-pdo php-cli php-gd php-mysql php-snmp php-zend-optimizer php php-odbc php-mbstring php-imap php-common php-pgsql php-xmlrpc php-devel php-pear php-mcrypt

And then re-install with :

yum install php-pdo php-cli php-gd php-mysql php-snmp php php-odbc php-mbstring php-imap php-common php-pgsql php-xmlrpc php-devel php-pear php-mcrypt

Also, if you do this be sure to restart Apache afterwards.