0

I'm using xampp on windows 7 to develop my programs but I've got a problem.

I try to start ImageMagick via the exec() function.

Here is my Code sniped.

<?php
    $command = 'convert '.$tempOverlay.' '.$tempBg.' -compose Overlay -composite '.$tempImage;
    exec($command);
    die($command);
?>

If i enter the filled $command (convert temp/100000231446889-overlay.jpg temp/100000231446889-bg.jpg -compose Overlay -composite temp/100000231446889.jpg)in my cmd in the right folder its works perfectly, but with it executed by php i get no output of ImageMagick.

I checked if its executed in the right folder via ' Echo %CD%' but its the right folder.

4
  • Why aren't you using php-imagick? php.net/manual/en/book.imagick.php Commented Nov 11, 2011 at 18:50
  • I weren't able to find the function for the "-compse Overlay" command Commented Nov 11, 2011 at 18:52
  • what $output do you get?: exec($command, $output); print_r($output); Commented Nov 11, 2011 at 20:31
  • Array ( )... dont get no output Commented Nov 11, 2011 at 21:50

2 Answers 2

3

This can happen, when you install the dll version of imagemagick. You need to install the static version. Whyever that happens, imagemagick cannot load its own dlls when called over php and the error output of imagemagick goes not to the stdout. It goes to stderr. So you cannot see that from php.

Sign up to request clarification or add additional context in comments.

Comments

1

A nice shot would be avoid relative path. Use full path for a test. It really looks like a path problem...

Or increment exec command with cd + dir caught with PHP.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.