ispCP - Board - Support
[SOLVED] Gallery2 can't use Imagemagick ? - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: [SOLVED] Gallery2 can't use Imagemagick ? (/thread-2226.html)



[SOLVED] Gallery2 can't use Imagemagick ? - psygarden - 01-24-2008 07:50 AM

I wish i could understand german a little bit better, but i'm having the same issue as in this post:

http://www.isp-control.net/forum/erledigt-gallery2-drawffmpegimagemagick-t-1816.html

I can't seem to get imagemagick installed on my server, i've built from source without error, but my Gallery2 installation can't seem to use it...

Quote:psygarden:/usr/local/bin# l
total 316K
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 animate
-rwxrwxrwx 1 root root 28K 2008-01-23 19:13 compare
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 composite
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 conjure
-rwxrwxrwx 1 root root 28K 2008-01-23 19:13 convert
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 display
-rwxrwxrwx 1 root root 28K 2008-01-23 19:13 identify
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 import
-rwxrwxrwx 1 root root 1.3K 2008-01-23 19:13 Magick-config
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 mogrify
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 montage
-rwxrwxrwx 1 root root 26K 2008-01-23 19:13 stream
-rwxrwxrwx 1 root root 1.3K 2008-01-23 19:13 Wand-config


This is the error i get from gallery2 when i test the availability for the functions:

Quote: ImageMagick binary test results
Binary Name Pass/Fail
identify
Failed
Error messages:

Problem executing binary:

identify
Failed
Error messages:

Problem executing binary:

convert
Failed
Error messages:

Problem executing binary:

composite
Failed
Error messages:

Problem executing binary:

Debug output (4 failed tests) -

We gathered this debug output while testing your ImageMagick binaries. If you read through this carefully you may discover the reason why your ImageMagick binaries failed the tests.

realpath(/usr/bin/)
realpath(/var/www/virtual/psygarden.be/)
realpath(/usr/share/php/)
Loading plugin imagemagick
imagemagick plugin successfully instantiated
Check the version of the imagemagick plugin
The version of the imagemagick plugin is ok
getcwd()
chdir(/var/www/virtual/psygarden.be/g2data/tmp/)
file_exists(/usr/bin/gm)
realpath(/usr/bin/identify)
realpath(/var/www/virtual/psygarden.be/)
realpath(/usr/share/php/)
getParameter exec.beNice for core plugin
Executing: ( "/usr/bin/identify"
"/var/www/virtual/psygarden.be/htdocs/g2/modules/imagemagick/data/test.gif"
) 2>/var/www/virtual/psygarden.be/g2data/tmp/g2dbga17pze
getParameter exec.expectedStatus for core plugin
file_exists(/var/www/virtual/psygarden.be/g2data/tmp/g2dbga17pze)
filesize(/var/www/virtual/psygarden.be/g2data/tmp/g2dbga17pze)
unlink(/var/www/virtual/psygarden.be/g2data/tmp/g2dbga17pze)
Regular Output:
Error Output:
Status: (expected 0)
file_exists(/usr/bin/gm)
tempnam(/var/www/virtual/psygarden.be/g2data/tmp/, imgk_)
realpath(/usr/bin/convert)
realpath(/var/www/virtual/psygarden.be/)
realpath(/usr/share/php/)
Executing: ( "/usr/bin/convert" "-size" "200x200" "-geometry" "200x200"
"/var/www/virtual/psygarden.be/htdocs/g2/modules/imagemagick/data/test.gif"
"/var/www/virtual/psygarden.be/g2data/tmp/imgk_7lapMO" )
2>/var/www/virtual/psygarden.be/g2data/tmp/g2dbgdptpZo
file_exists(/var/www/virtual/psygarden.be/g2data/tmp/g2dbgdptpZo)
filesize(/var/www/virtual/psygarden.be/g2data/tmp/g2dbgdptpZo)
unlink(/var/www/virtual/psygarden.be/g2data/tmp/g2dbgdptpZo)
Regular Output:
Error Output:
Status: (expected 0)
unlink(/var/www/virtual/psygarden.be/g2data/tmp/imgk_7lapMO)
file_exists(/usr/bin/gm)
file_exists(/usr/bin/combine)
file_exists(/usr/bin/composite)
file_exists(/usr/bin/gm)
tempnam(/var/www/virtual/psygarden.be/g2data/tmp/, imgk_)
Executing: ( "/usr/bin/composite" "-geometry" "+0+0"
"/var/www/virtual/psygarden.be/htdocs/g2/modules/imagemagick/data/test.jpg"
"/var/www/virtual/psygarden.be/htdocs/g2/modules/imagemagick/data/test.gif"
"/var/www/virtual/psygarden.be/g2data/tmp/imgk_4clucZ" )
2>/var/www/virtual/psygarden.be/g2data/tmp/g2dbg0MXzpz
file_exists(/var/www/virtual/psygarden.be/g2data/tmp/g2dbg0MXzpz)
filesize(/var/www/virtual/psygarden.be/g2data/tmp/g2dbg0MXzpz)
unlink(/var/www/virtual/psygarden.be/g2data/tmp/g2dbg0MXzpz)
Regular Output:
Error Output:
Status: (expected 0)
unlink(/var/www/virtual/psygarden.be/g2data/tmp/imgk_4clucZ)
chdir(/var/www/virtual/psygarden.be/htdocs/g2)

Does anyone have any suggestion what i might be missing out on?


RE: Gallery2 can't use Imagemagick ? - joximu - 01-24-2008 09:09 AM

Did you enable the disabled functions in php.ini?

Try to enable php error-logging...


RE: Gallery2 can't use Imagemagick ? - gOOvER - 01-24-2008 05:36 PM

Try to remove "passthrough" from the disabled functions in the right php.ini. restart apache and test it.


RE: Gallery2 can't use Imagemagick ? - psygarden - 01-24-2008 07:13 PM

I can't find any reference to passthrough in

/etc/php5/apache2/php.ini
nor
/etc/php5/cgi/php.ini

Am i looking in the wrong place?


RE: Gallery2 can't use Imagemagick ? - BeNe - 01-24-2008 07:18 PM

You have PM!

Greez BeNe


RE: Gallery2 can't use Imagemagick ? - psygarden - 01-24-2008 07:30 PM

I got it working now, thanks a lot!

Here is a small roundup for other people that have the same issue:

1) Install imagemagick (compile from source or "apt-get install imagemagick" for debian users

2) You need to disable some security features in your php.ini so gallery can use the commands needed to resize images.

There are many php.ini files on your system, a global one for your apache2, one for cgi (both in /etc/php5/...) These are not the ones!

The one you should be looking for (example from my debian install):

/var/www/fcgi/YOURDOMAIN.COM/php5/php.ini

Here you look for this part of the file:

Quote:; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, shell, symlink, popen, proc_open

This is a security mesure for certain actions, we need to disable a few... here is my current line that i'm using:

Quote:disable_functions = show_source, system, shell, popen, proc_open

3) restart apache2 using the "/etc/init.d/apache2 restart" command

4) go to your gallery admin panel and activate the imagemagick module, and configure it with the folder "/usr/bin/"

Tests should succeed now.

greetings,
Rik


RE: Gallery2 can't use Imagemagick ? - BeNe - 01-24-2008 07:53 PM

Fine!
Thanks for your short howto Smile

Marked as [SOLVED]

Greez BeNe