An example:
Code: Select all
<?php
// This works without a problem
exec("magick input.jpg output.png");
?>
<?php
// This fails with:
//Parse error: syntax error, unexpected '"<pre>"' (T_CONSTANT_ENCAPSED_STRING) in E:\XAMPP\htdocs\imagemagick\bla.php on line 9
// If I remove the echo "<pre>"; I then get:
// Parse error: syntax error, unexpected '$array' (T_VARIABLE) in E:\XAMPP\htdocs\imagemagick\bla.php on line 10
$array=array();
echo "<pre>";
exec("magick input.jpg output.png 2>&1", $array);
echo "<br>".print_r($array)."<br>";
echo "</pre>";
?>