warning: is_file() [function.is-file]: open_basedir

alimosavi - October 19, 2009 - 06:36
Project:ImageAPI
Version:6.x-1.6
Component:ImageAPI Imagick
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi

How i can resolve this problem :

warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s): (/home/httpd/irdrupal.com/httpdocs:/home/httpd/irdrupal.com/irdrupal.com:/home/irdrupal/:/tmp:/usr/share/pear:/var/lib/php/session/:/home/kloxo/httpd/script) in /home/irdrupal/irdrupal.com/sites/all/modules/imageapi/imageapi_imagemagick.module on line 162

#1

alexh - October 23, 2009 - 10:40
Component:ImageAPI GD» ImageAPI Imagick

The module logic assumes that you cannot use ImageMagick if the open_basedir security restriction is enabled.
But this is not true. On my shared host, I can execute /usr/bin/convert although it is not on the allowed paths.
Therefore, I added the following check in front of the others in the function _imageapi_imagemagick_check_path in the file imageapi_imagemagick.module (line 162):

  // Try it out and return without errors on success
  $handle = popen($path . " -version", 'r');
  $im_version = fread($handle, 2096);
  pclose($handle);
  if (strpos($im_version, 'ImageMagick') !== FALSE) {
    return $errors;
  }

You can try with this. If it does not work you can also try to copy convert one of the allowed paths.

P.S. I changed Component to Imagick, because it is not related to GD, but to ImageMagick.

#2

khan2ims - November 2, 2009 - 04:50

Thanks! The above worked for me!

Imran Khan
Project Manager
New Earth Marketing

 
 

Drupal is a registered trademark of Dries Buytaert.