Showing the debug output

The output of -debug is sent to stdout ( depending on the settings in the log.xml configuration file ) and can be displayed using this code.

<?php
$array 
= array();
echo 
"<pre>";
exec("convert -debug all output.png output.jpg 2>&1"$array); 
echo 
"<br>".print_r($array)."<br>"
echo 
"</pre>";
?> 

Output without any errors:
Array
(
[0] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: utility.c/ExpandFilenames/826/Configure
[1] => Command line: convert {-debug} {all} {output.png} {output.jpg}
[2] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Module convert[3624]: module.c/OpenModule/1144/Module
[3] => Searching for module "PNG" using filename "IM_MOD_RL_PNG_.dll"
[4] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Module convert[3624]: module.c/GetMagickModulePath/549/Module
[5] => Searching for coder module file "IM_MOD_RL_PNG_.dll" ...
[6] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1622/Configure
[7] => SOFTWARE\ImageMagick\6.5.1\Q:16
[8] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1640/Configure
[9] => CoderModulesPath
[10] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Module convert[3624]: module.c/OpenModule/1153/Module
[11] => Opening module at path "C:\Program Files\ImageMagick-6.5.1-Q16\modules\coders\IM_MOD_RL_PNG_.dll"
[12] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Module convert[3624]: module.c/OpenModule/1180/Module
[13] => Method "RegisterPNGImage" in module "PNG" at address 67830900
[14] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Module convert[3624]: module.c/OpenModule/1194/Module
[15] => Method "UnregisterPNGImage" in module "PNG" at address 67829710
[16] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Blob convert[3624]: blob.c/OpenBlob/2367/Blob
[17] => read 3 magic header bytes
[18] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Cache convert[3624]: cache.c/DestroyPixelCacheInfo/1513/Cache
[19] => destroy
[20] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1622/Configure
[21] => SOFTWARE\ImageMagick\6.5.1\Q:16
[22] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1640/Configure
[23] => ConfigurePath
[24] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: configure.c/GetConfigureOptions/528/Configure
[25] => Searching for configure file: "C:\Program Files\ImageMagick-6.5.1-Q16\config\magic.xml"
[26] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: configure.c/GetConfigureOptions/528/Configure
[27] => Searching for configure file: "C:\Users\Anthony\.magick\magic.xml"
[28] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: configure.c/GetConfigureOptions/528/Configure
[29] => Searching for configure file: "c:\program files\imagemagick-6.5.1-q16\magic.xml"
[30] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: configure.c/GetConfigureOptions/528/Configure
[31] => Searching for configure file: "magic.xml"
[32] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: magic.c/LoadMagicList/682/Configure
[33] => Loading magic configure file "C:\Program Files\ImageMagick-6.5.1-Q16\config\magic.xml" ...
[34] => 2009-06-06T19:52:00+01:00 0:01 0.000u 6.5.1 Configure convert[3624]: magic.c/LoadMagicList/682/Configure
[35] => Loading magic configure file "magic.xml" ...
[36] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadPNGImage/2855/Coder
[37] => enter ReadPNGImage()
[38] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Blob convert[3624]: blob.c/OpenBlob/2367/Blob
[39] => read 3 magic header bytes
[40] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1690/Coder
[41] => enter ReadOnePNGImage()
[42] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1820/Coder
[43] => PNG width: 1598, height: 2362
[44] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1823/Coder
[45] => PNG color_type: 2, bit_depth: 16
[46] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1826/Coder
[47] => PNG compression_method: 0
[48] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1829/Coder
[49] => PNG interlace_method: 0, filter_method: 0
[50] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/1964/Coder
[51] => Reading PNG pHYs chunk: xres: 72, yres: 72, units: 0.
[52] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2252/Coder
[53] => Reading PNG IDAT chunk(s)
[54] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2264/Coder
[55] => Converting PNG pixels to pixel packets
[56] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Resource convert[3624]: resource.c/AcquireMagickResource/221/Resource
[57] => Area: 28.8mb/28.8mb/6.4966gb
[58] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Resource convert[3624]: resource.c/AcquireMagickResource/221/Resource
[59] => Memory: 28.8mb/28.8mb/4.8725gb
[60] => 2009-06-06T19:52:00+01:00 0:01 0.016u 6.5.1 Cache convert[3624]: cache.c/OpenPixelCache/3832/Cache
[61] => open output.png[0] (heap memory, 1598x2362 28.8mb)
[62] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2688/Coder
[63] => Reading PNG text chunk
[64] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2711/Coder
[65] => Keyword: create-date
[66] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2688/Coder
[67] => Reading PNG text chunk
[68] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2711/Coder
[69] => Keyword: modify-date
[70] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadOnePNGImage/2816/Coder
[71] => exit ReadOnePNGImage()
[72] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: png.c/ReadPNGImage/2922/Coder
[73] => exit ReadPNGImage()
[74] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Module convert[3624]: module.c/OpenModule/1144/Module
[75] => Searching for module "JPEG" using filename "IM_MOD_RL_JPEG_.dll"
[76] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Module convert[3624]: module.c/GetMagickModulePath/549/Module
[77] => Searching for coder module file "IM_MOD_RL_JPEG_.dll" ...
[78] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1622/Configure
[79] => SOFTWARE\ImageMagick\6.5.1\Q:16
[80] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Configure convert[3624]: nt-base.c/NTRegistryKeyLookup/1640/Configure
[81] => CoderModulesPath
[82] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Module convert[3624]: module.c/OpenModule/1153/Module
[83] => Opening module at path "C:\Program Files\ImageMagick-6.5.1-Q16\modules\coders\IM_MOD_RL_JPEG_.dll"
[84] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Module convert[3624]: module.c/OpenModule/1180/Module
[85] => Method "RegisterJPEGImage" in module "JPEG" at address 00E55710
[86] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Module convert[3624]: module.c/OpenModule/1194/Module
[87] => Method "UnregisterJPEGImage" in module "JPEG" at address 00E53D70
[88] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1681/Coder
[89] => Image resolution: 72,72
[90] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Resource convert[3624]: resource.c/AcquireMagickResource/221/Resource
[91] => Memory: 10.8mb/39.6mb/4.8725gb
[92] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Resource convert[3624]: resource.c/RelinquishMagickResource/856/Resource
[93] => Memory: 10.8mb/28.8mb/4.8725gb
[94] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1763/Coder
[95] => Interlace: non-progressive
[96] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1778/Coder
[97] => Quality: 0
[98] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1882/Coder
[99] => Storage class: DirectClass
[100] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1884/Coder
[101] => Depth: 16
[102] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1890/Coder
[103] => Number of colors: unspecified
[104] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1892/Coder
[105] => JPEG data precision: 8
[106] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1946/Coder
[107] => Image colorspace is RGB
[108] => 2009-06-06T19:52:01+01:00 0:01 0.328u 6.5.1 Coder convert[3624]: jpeg.c/WriteJPEGImage/1948/Coder
[109] => Sampling factors: 2x2,1x1,1x1
[110] => 2009-06-06T19:52:01+01:00 0:01 0.515u 6.5.1 Resource convert[3624]: resource.c/RelinquishMagickResource/856/Resource
[111] => Memory: 28.8mb/0b/4.8725gb
[112] => 2009-06-06T19:52:01+01:00 0:01 0.515u 6.5.1 Cache convert[3624]: cache.c/DestroyPixelCacheInfo/1513/Cache
[113] => destroy output.png[0]
)
1