multiple installations of a program?

June 3, 2016 257 views
Apache PHP

I have installed Imagick on my server. However, while struggling to get it running I very likely installed it many times. At least that is what it looks like when I look in my error log. There I see a dozen times the same lines:

PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0

My question is in which configuration file this is set and how I can repair it.

1 Answer

This error does not mean that you have more than one copy of something installed. Instead it means that within the code you are running there are more than one require('imagick') lines. PHP will display this warning when you try to do a require() on something that has already been included earlier in the code. This can be corrected by either including the package only once or changing these lines to require_once which will not attempt to include it if it's already been included.

Have another answer? Share your knowledge.