Closed (fixed)
Project:
Image
Version:
5.x-1.0
Component:
imagemagick toolkit
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2007 at 01:40 UTC
Updated:
23 Nov 2010 at 20:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedthere've been some changes to the imagemagick toolkit going into the 5.x-1.0 release. did you have this working before hand with an older version?
a couple of other data points that might help. do you know what OS your host is using? what version of php are you running?
Comment #2
dougpetch commentedNo, I've yet to get imagemagick to work. My host is running php 4.4.4 on Linux.
Comment #3
drewish commentedtry
/usr/bin/convertnot/user/bin/convert, another path might be/usr/local/bin/convertComment #4
dougpetch commentedActually, that was a typo. I am using /usr/bin/convert and have confirmed with my host that it's the correct path. Sorry 'bout that....
Comment #5
drewish commentedplease try out the attached patch. it changes around the way the path is validated
Comment #6
dougpetch commentedI applied the patch locally, replaced the image.imagemagick.inc file on my server with the patched version and ran update.php. The following error message appeared as soon as I opened the Image Toolkit page under administer-->site configuration:
The specified ImageMagic path /usr/bin/convert/ does not exist.
This is a minor change, as I previously only received the error when I attempted to "save configuration."
Comment #7
drewish commenteddoes it display the path with a trailing slash?
Comment #8
drewish commentedthis really shouldn't change much but it'll print the version info correctly now if you do get it working ;)
(i trying to keep my latest patches posted because i often delete the code to test other patches and forget to a backup)
Comment #9
dougpetch commentedI've run the latest path and as you predicted it did not change the problem. And no, the trailing slash does not display - both the path textbox and the error message refer to /usr/bin/convert
Comment #10
dougpetch commentedI actually ran the latest patch, not the latest path....
Comment #11
drewish commentedcould you install the devel module and enable the php block? once you get that installed could you run the following code? it should set a message with information on the file:
Comment #12
drewish commentedrun this too while you're at it:
Comment #13
dougpetch commentedRunning the first line returned the following error:
warning: filetype() [function.filetype]: open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s): (/home/dougp/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/dougp/public_html/drupal/modules/devel/devel.module(624) : eval()'d code on line 1.
Running the second line returned the following message:
Parse error: syntax error, unexpected $end in /home/dougp/public_html/drupal/modules/devel/devel.module(624) : eval()'d code on line 1
If you haven't guessed by now, I'm not a programmer (and I don't play one on tv and I didn't stay at a holiday inn express), so I don't know what these messages are telling me or what I need to do to correct the problems. Hopefully though it will tell you that there's something simple that I need to do/undo to fix my problem....
Comment #14
drewish commentedwell,
open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s):says it all. you can't call image magick because they've got php's safe mode enabled. you'll need to talk to them about it.Comment #15
drewish commentedokay we should really add code to warn people if this prevents access to image magick
Comment #16
dougpetch commentedWaiting on a response from my hosting service. Will update upon receipt.
Comment #17
dougpetch commentedConfirmed that safe_mode is enabled and that I am permitted to disable through a local php.ini file. Only problem - I don't know the correct command to use in the php.ini file I will create, and searching for the answer has been more confusing than helpful. The only command in the .ini file will be to disable safe_mode - could you possibly provide the correct command to make that happen? thx.
Comment #18
drewish commentedyou could do it via your .htacccess file:
php_admin_value open_basedir none
or in the php.ini file:
open_basedir = ""
Comment #19
dougpetch commentedFinally got imagemagick working by modifying php_admin_value in .htaccess. Thanks for your help - and your patience.
Comment #20
drewish commentedglad you got it working. could you do me one favor and let me know if the existing patch works for you?
Comment #21
drewish commentedokay, here's a patch that provides a warning if php's open_basedir feature is in use and the convert binary cannot be found. would you mind giving it a test?
Comment #22
dougpetch commentedI don't mind checking the patches and such, but after reinstalling the devel module in the modules folder I received the following error:
Fatal error: Call to undefined function: drupal_add_js() in /home/dougp/public_html/drupal/modules/devel/devel.module on line 166
Keep in mind - I'm not a programmer or developer so I have no idea what caused the error or how to fix it. And, since I'm running a production site I'm removing the devel module (again) in order to keep managing my site. If there's a simple fix to the error that you can share I'll be happy to try again for you, though.
Comment #23
dougpetch commentedSorry - disregard #22 - operator head-space and timing issue. In answer to #20, I'm assuming that the existing patch is working because I am now able to enable imagemagick and it's saving images properly (thumbnail/preview/original). Is that what you're asking? As for #21 - since I now have access to the convert binary what, if anything, will the new patch do for me (that will be helpful for you, that is)?
Comment #24
drewish commentedsince you became my imagemagick guinea pig (wink), just confirm that it still works for you, if you wouldn't mind, perhaps comment out the open_basedir line from your .htaccess to test that it fails with a warning that open_basedir might be screwing things up... if you could check those to things i'd really appreciate it.
Comment #25
dougpetch commentedThe good news is that,yes things are working as they should with the patch installed and access to the convert binary enabled. The bad news is that the php_admin_value was actually changed in the global httpd.conf file for the server (as opposed to my site's .htaccess file as I originally thought) so I won't be able to easily disable it to test the warning function of the newest patch. Sorry - being your guinea pig has been a good learning experience for me.
Comment #26
drewish commentedit worked for me but it's nice to get independent verification. i've committed this to HEAD and DRUPAL-5.
Comment #27
(not verified) commentedComment #28
jamesbrown commentedI have the same problem now.
Apache/2.2.17 (FreeBSD)
PHP 5.2.14 with Suhosin-Patch 0.9.7 (cli) (built: Oct 19 2010 11:55:04)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
drupal-6.19
safe-mode in my php.ini is off, open_basedir is commented, as I see in phpinfo :
php -i | grep basedir
open_basedir => no value => no value
After writing "php_admin_value open_basedir none" in .htaccess I have error № 500 in my browser with my site.
P.S. I have the next record in my local (not sistem) php.ini (/home/user/data/php-bin/php.ini):
session.save_path = "/home/bahrain/data/bin-tmp"
Commenting that record and making in that directory symbolic reference to the /usr/local/bin/convert (under FreeBSD I have that file in /usr/local/bin) don't bring me any success.