Page 1 of 1

Problem with php and magick

Posted: 2016-09-18T03:21:33-07:00
by Bonzo
I am having a problem with something that used to work OK with convert but fails with magick.

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>";
?> 
Any ideas as this method of error reporting used to work with convert?