[PHP] PHP Warning: Module ‘mcrypt’ already loaded in Unknown on line 0

Like in the title, PHP Warning: Module ‘mcrypt’ already loaded in Unknown on line 0.
When we launch whatever a command PHP, for example php -v, we will see the warning :

# php -v
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
...

This warning was caused by the duplicated configuration of the mcrypt extension.

To check it, we can use this command (the path could be changed depends on the local configuration):

grep "extension=mcrypt.so" /etc/php5/cli/php.ini

and

grep "extension=mcrypt.so" /etc/php5/cli/conf.d/mcrypt.ini

If the two command return the same thing : “extension=mcrypt.so”, this means the extension is included two times.

The solution is simple, juste remove one of these configuration, that will be ok.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s