ImageMagick/GraphicsMagick Problems

bkwyrm

Joined: 2005-08-28
Posts: 4
Posted: Tue, 2009-07-07 23:32

So, according to my log, neither convert nor gm can be found:
Trying to update using ImageMagic as selected graphic program -

Quote:
The ImageMagick directory specified does not contain a required program, convert.

Trying to rotate using ImageMagic as selected graphic program -

Quote:
2009-07-07 15:45:32 -07:00 --- error: Uncaught Kohana_Exception: The ImageMagick directory specified does not contain a required program, convert. in file system/libraries/drivers/Image/ImageMagick.php on line 46

Trying to update using GraphicMagic as selected graphic program -

Quote:
The GraphicsMagick directory specified does not contain a required program, gm.

Apache is run by www-data

Quote:
/etc/apache2# grep -R www-data .
./envvars:export APACHE_RUN_USER=www-data
./envvars:export APACHE_RUN_GROUP=www-data

My user is part of the www-data group

Quote:
www-data:x:33:otoshigo

And the whole gallery3 ("snaps") dir is owned by me and the apache user-group, recursively, ad nauseum -

Quote:
asdf@server:/path/path/path/# ls -al snaps/
total 76
drwxr-xr-x 9 otoshigo www-data 4096 2009-07-07 16:01 .
drwxr-xr-x 3 otoshigo www-data 4096 2009-07-07 13:28 ..
drwxr-xr-x 3 otoshigo www-data 4096 2009-06-05 17:53 application
-rw-r--r-- 1 otoshigo www-data 238 2009-06-05 17:53 .htaccess
-rw-r--r-- 1 otoshigo www-data 2863 2009-06-05 17:53 index.php
drwxr-xr-x 3 otoshigo www-data 4096 2009-06-05 17:53 installer
drwxr-xr-x 6 otoshigo www-data 4096 2009-06-05 17:53 lib
-rw-r--r-- 1 otoshigo www-data 18011 2009-06-05 17:53 LICENSE
drwxr-xr-x 20 otoshigo www-data 4096 2009-06-05 17:53 modules
-rw-r--r-- 1 otoshigo www-data 2923 2009-06-05 17:53 README
drwxr-xr-x 9 otoshigo www-data 4096 2009-06-05 17:53 system
drwxr-xr-x 4 otoshigo www-data 4096 2009-06-05 17:53 themes
drwxrwxrwx 9 otoshigo www-data 4096 2009-07-07 13:34 var

both convert and gm truly do live in /usr/bin

Quote:
sdf@server:/path/path/path# ls -al /usr/bin/convert
-rwxr-xr-x 1 root root 5232 2008-02-18 23:08 /usr/bin/convert
asdf@server:/path/path/path# ls -al /usr/bin/gm
-rwxr-xr-x 1 root root 5872 2008-03-28 03:40 /usr/bin/gm

and /usr/bin is in the apache user's path:

Quote:
asdf@server:/path/path/path# su www-data
$ echo $PATH;
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
$ exit

Further server info:

Quote:
PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 17 2009 14:31:37)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Quote:
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2

Quote:
Server version: Apache/2.2.8 (Ubuntu)
Server built: Jun 25 2008 13:54:13

Everything seems set up correctly.... Any idea why Gallery3 cannot find IM/GM? Any help would be greatly appreciated...

Addendum:
As with Ticket number 423 (http://sourceforge.net/apps/trac/gallery/ticket/423) GD2 is working fine for me, although terribly slowly. I am not hitting an open_basedir error, as evinced by both the suggested tests found in numerous places on the forum, as well as by the path info above. I have root on my machine. Changing the graphics_toolkit_path from /usr/bin (which is where both live as shown above) to /usr/bin/convert simply resulted in a repeat of the following error:

Quote:
2009-07-07 18:01:48 -07:00 --- error: Uncaught Kohana_Exception: The ImageMagick directory specified does not contain a required program, convert. in file system/libraries/drivers/Image/ImageMagick.php on line 46

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-13 03:41

Try putting the following into a file and browsing to it:

<?
print_r(array(realpath("/usr/bin/convert"), is_file(realpath("/usr/bin/convert"))));
?>

What do you get? I'm guessing you're getting an open_basedir error.
FAQ: Why do I get errors like this: Warning: open_basedir restriction in effect. File is in wrong directory in /home/johndoe/public_html/gallery/platform/fs_unix.php on line 53?

---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
bkwyrm

Joined: 2005-08-28
Posts: 4
Posted: Wed, 2009-07-15 06:47

Sir -

This:

Quote:
<?
print_r(array(realpath("/usr/bin/convert"), is_file(realpath("/usr/bin/convert"))));
?>
<?
print_r(array(realpath("/usr/bin/gm"), is_file(realpath("/usr/bin/gm"))));
?>

does this:

Quote:
Array ( [0] => [1] => ) Array ( [0] => [1] => )

on this page:

http://www.lilbrown.net/snaps/test.php

Thank you for your help with this.

Kristin

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2009-07-16 02:48

I haven't seen any evidence yet that this is not open_basedir related. Can you provide us with access to your phpinfo() output, preferably from a test file *inside* your gallery3 dir?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
simcen

Joined: 2010-08-14
Posts: 1
Posted: Sat, 2010-08-14 14:08

Hi folks,

Had the same problem here on gallery3 rc2. My solution was to change

Quote:
open_basedir = "/var/www/virtual/myfolder/:/usr/share/php/:/usr/bin/gm"

to

Quote:
open_basedir = "/var/www/virtual/myfolder/:/usr/share/php/:/usr/bin/"

Can't really figure out why it doesn't work when only allowing the binary itself in open_basedir instead of the full /usr/bin directory.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2010-08-14 19:05

That makes sense, since open_basedir works on directories and /usr/bin/gm is a file.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git