Page 1 of 1

Help on getting IM to work on a windows server

Posted: 2007-10-24T03:06:44-07:00
by Nijo
Hi all,

i am working on a windows server and only have FTP access so i cannot use the console.

The sys admin installed imagemagick on the server for me but i am having trouble getting it to work.

I have tried the following code:

Code: Select all

<?php
echo "<pre>";
system('which convert', $path); 
print_r($path);
echo "</pre>";

exec('convert press_04.jpg -crop 287x163+49+16 graph2.gif');
echo "<br>".print_r($array)."<br>";

exec('convert W:\\www\\kmedev\\press_04.jpg -crop 287x163+49+16 W:\\www\\kmedev\\graph.gif');
echo "<br>".print_r($array)."<br>";


$path = "C:\\Program Files\\ImageMagick-6.3.6-Q16\\";
$cmd = $path . "convert.exe";
exec( $cmd .' W:\\www\\kmedev\\press_04.jpg W:\\www\\kmedev\\graph.gif');
echo "<br>".print_r($array)."<br>";
?>
But this ouputs:

Code: Select all

<pre>1</pre><br>1<br><br>1<br><br>1<br>
Since i do not have access to any log files or some such, i can hardly guess whats wrong.

Is there any way to geta more verbose answer from the server?
Or how do i create a batch script - would a content like "convert filea.jpg filgeb.eps" saved as test.bat be sufficient?

I really need to get this to work quickly but i have no idea where else to look, help pls ;)

Re: Help on getting IM to work on a windows server

Posted: 2007-10-24T03:41:45-07:00
by Bonzo
1 = fail so all your comands failed

You could try this to find the path to convert instead. If this does not work I would say you have a setup error on the server and you need to talk to your system administrator again.
If he is happy it is installed OK get him to provide you with the path to convert.

Code: Select all

<?php
echo "<pre>";
system("type convert"); 
echo "</pre>";
?>

Re: Help on getting IM to work on a windows server

Posted: 2007-10-24T04:36:17-07:00
by Nijo
This just echoes

Code: Select all

<pre></pre>
.

The path to convert should be:

Code: Select all

$path = "C:\\Program Files\\ImageMagick-6.3.6-Q16\\";
$cmd = $path . "convert.exe";
The sys admin sent me this error message from the log:
Apache logs report this:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

So i included the path in single quotes, but nothing changed.

Re: Help on getting IM to work on a windows server

Posted: 2007-10-24T05:45:57-07:00
by Nijo
Can i somehow check if IM is installed correctly?

Should anything show up in phpinfo?

Re: Help on getting IM to work on a windows server

Posted: 2007-10-24T06:32:57-07:00
by Nijo
Okay, the sys admin had the glorious idea to restart the server and it works fine now.
Thanks for your efforts ;)

Re: Help on getting IM to work on a windows server

Posted: 2007-10-24T10:17:58-07:00
by Bonzo
I am glad you got it sorted OK.