1

So I checked my spam folder today and had 122 messages send through the server stating: PHP Warning: Module 'imagick' already loaded in Unknown on line 0

Non stop it keeps sending me this.

Googled it and still have no clue on how to fix it as I need a step by step answer.

Found a similar question on stack but it's too complicated for me to understand.

I'm on the latest Plesk Onyx and OS=Ubuntu 16.04.6 LTS‬.

As I'm running php 7.3 I hoped when I uninstalled php 7.0 in plesk it would go away but unfortunately it didn't.

It's send from here

Cron <root@server>   [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean

And after php --ini (read about it on a forum) this was the result:

PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      /etc/php/7.0/cli/conf.d/00-ioncube-loader-7.0.ini,
/etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-imagick.ini,
/etc/php/7.0/cli/conf.d/20-imap.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sqlite3.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini,
/etc/php/7.0/cli/conf.d/20-zip.ini,
/etc/php/7.0/cli/conf.d/zend_extensions_psa.ini

I already know it's probably easily fixed when you know linux but I'm learning on the go and posses very little knowledge yet.

Could anyone assist me with the right commands?

Cheers

Space Money
  • 11
  • 1
  • 4
  • Anyone? I keep getting these mails all day every day :( – Space Money May 01 '19 at 11:29
  • 1
    The error message says it all and it should be straightforward to solve. Essentially PHP is being asked to install the imagick module more than once while starting up. Assuming that it's not already built into PHP, check /etc/php/7.0/cli/conf.d/20-imagick.ini to see if it's referenced more than once there. Then check the main php.ini file /etc/php/7.0/cli/php.ini to see if it's referenced there. It's unlikely to be in any of the others but you could check if necessary. Once you've found the duplicate reference, reduce to have a single reference. Good luck! – Nick May 08 '19 at 14:08

1 Answers1

1

Locate where is your php.ini file by:

php -i | grep Configuration
Configuration File (php.ini) Path => /usr/local/etc/php/7.4
Loaded Configuration File => /usr/local/etc/php/7.4/php.ini

Open the php.ini file and remove the line:

extension=imagick.so

or change the line to a comment:

; extension=imagick.so
ohho
  • 50,879
  • 75
  • 256
  • 383