diff --git a/imageapi_imagemagick.module b/imageapi_imagemagick.module
index a375e12..a2ac47a 100644
--- a/imageapi_imagemagick.module
+++ b/imageapi_imagemagick.module
@@ -191,7 +191,7 @@ function _imageapi_imagemagick_convert_exec($command_args, &$output, &$errors) {
     1 => array('pipe', 'w'), // stdout
     2 => array('pipe', 'w')  // stderr
   );
-  if ($h = proc_open($convert_path .' '. $command_args, $descriptors, $pipes, $_SERVER['DOCUMENT_ROOT'])) {
+  if ($h = proc_open($convert_path .' '. $command_args, $descriptors, $pipes, getcwd())) {
     $output = '';
     while (!feof($pipes[1])) {
       $output .= fgets($pipes[1]);
