My first thought is that it might be something about std and an output error. Some tools unload some data about the STD, and some in the std error. If you do not redirect the std error to std-out, most system calls return only a portion of stdout. It looks like you see all the output in the terminal and cannot in system calls. Therefore try
/usr/local/bin/chbg -mt 2>&1
Edit: Also, for temporary work you can try other things. For example, redirect the output to a file next to the script and read its contents after running the command. This way you can use exec:
exec("usr/local/bin/chbg -mt 2>&1 > chbg_out"); //Then start reading chbg_out and see is it work
Edit2 It also doesn't make sense why others don't work for you. For example, this piece of code written in c produces a string in stderr, and in stdout another.
#include <stdio.h> #include<stdlib.h> int main() { fputs("\nerr\nrro\nrrr\n",stderr); fputs("\nou\nuu\nuttt\n",stdout); return 0; }
and this php script, trying to run this through exec:
<?php exec("/tmp/ctest",&$result); foreach ( $result as $v ) { echo $v; }
Look, it unloads the original string anyway. But he did not get stderr. Now consider the following:
<?php exec("/tmp/ctest 2>&1",&$result); foreach ( $result as $v ) { echo $v; }
Look, this time we got the whole results.
This time the system:
<?php echo system("/tmp/ctest 2>&1");
etc.