Path - find automaticaly


<?php
// In my case $HTTP_ENV_VARS['PATH'] = bin:usr/bin
$env_vars = explode( \':\', $HTTP_ENV_VARS['PATH']);

// Combine the required part from $HTTP_ENV_VARS[\'PATH\'] and convert for your path.
$env_path = $env_vars[1]."/convert";

// Now $env_path = usr/bin/convert
// Use like:
exec("$env_path input.jpg -resize 100x100 output.jpg");
?>

This will find the path to convert etc. automaticaly. But may not work on all setups.