title: imagemagick convert command not working correctly in php script but does work from command line
body: <p>A system call to convert in php worked for years but quit working early this year.  All commands that I am using work correctly if issued from the command line using Putty.</p>
  
  <p>A test php file I created to debug this is</p>
  
  <pre><code>&lt;?  
  $string = "convert  -verbose -resize 200x200  \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";
  passthru($string);
  ?&gt;
  
  &lt;IMG SRC='image/temp222_main_menu.png '  alt='main_menu'&gt;
  </code></pre>
  
  <p>The output file is not created.  I get this response</p>
  
  <pre><code>startline/main_menu.png PNG 600x1024 600x1024+0+0 8-bit DirectClass 92.1KB 0.020u 0:00.020
  </code></pre>
  
  <p>If I replace my string with this</p>
  
  <pre><code>$string = "convert  -version -resize 200x200  \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";
  </code></pre>
  
  <p>The output file is created but not resized.</p>
  
  <p>I get this response:</p>
  
  <pre><code>Version: ImageMagick 6.6.0-4 2012-04-26 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP
  </code></pre>
  
  <p>The interesting thing is that this worked from 2008 until early this year.  That may have been when I switched to PHP5 and a new server, not sure.  This is running at 1and1.com</p>
  
  <p>Tech support at 1and1 said the problem was the outfile didn't exist and closed the case.  That was not very helpful.</p>
  
  <p>I am wondering if there is something I need to put in my php.ini file or something.</p>
  
  <hr>
  
  <p>I also tried this:
      
      exec("/usr/bin/convert -resize 200x200  image/temp222_main_menu.png");
      ?>
      </p>
  
  <p>Just a note.  I put the verbose in so that I could be sure that I was in fact running the program, that there was some output returned.  It also shows that it is loading the correct file.  That is also why I used passthru instead of exec or system.  This is just a test script.  The script I was using before it broke did not use passthru but had too much going on to post.  The key is that the string that is executed does not work in php but does work on the command line so it is correct.</p>