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.
A test php file I created to debug this is
<?
$string = "convert -verbose -resize 200x200 \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";
passthru($string);
?>
<IMG SRC='image/temp222_main_menu.png ' alt='main_menu'>
The output file is not created. I get this response
startline/main_menu.png PNG 600x1024 600x1024+0+0 8-bit DirectClass 92.1KB 0.020u 0:00.020
If I replace my string with this
$string = "convert -version -resize 200x200 \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";
The output file is created but not resized.
I get this response:
Version: ImageMagick 6.6.0-4 2012-04-26 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP
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
Tech support at 1and1 said the problem was the outfile didn't exist and closed the case. That was not very helpful.
I am wondering if there is something I need to put in my php.ini file or something.
I also tried this: exec("/usr/bin/convert -resize 200x200 image/temp222_main_menu.png"); ?>
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.