user971011
user971011

Reputation: 31

ImageMagick works by command line but doesn't work from PHP

I use Windows 7 and Apache server on my personal computer to develop web applications. Today I installed the ImageMagick for Windows and when I try do an operation from command line it works, for example:

convert -scale "300x300>" -quality 80 -strip "d:/www/test.jpg" "d:/www/test2.jpg"

But the same command run from PHP doesn't work:

exec('convert -scale "300x300>" -quality 80 -strip "d:/www/test.jpg" "d:/www/test2.jpg"');

Why? Please help me!

Upvotes: 1

Views: 3033

Answers (2)

janosik
janosik

Reputation: 1

use below form for paths

d:\www\test.jpg
d:\www\test2.jpg

Upvotes: -1

Markus Hedlund
Markus Hedlund

Reputation: 24254

What do you mean by "doesn't work"? Any errors?

I successfully use imagemagick on Windows 7 from PHP, by using the absolute path to imagemagick.

exec('C:\imagemagick\convert -scale "300x300>" -quality 80 -strip "d:/www/test.jpg" "d:/www/test2.jpg"');

Upvotes: 3

Related Questions