You can run any program including compiled C programs and shell scripts in the shell by using back quotes and assigning the output to a variable. Be careful that the program is in the PATH and display the output. If it isn't you need to modify the PATH variable or use a valid absolute or relative path to the program. My example echoes out the default PATH for verification purposes:
echo `echo $PATH`;
$result=`myProg arg1 arg2 arg3`;
echo $result; #Or you can manipulate the result
I realized this is a 12 year old question but I came across it while looking for a question of my own - can PHP link to and use a binary C function call directly? The only solution I have at the moment is to wrap it in a full C program and use it as in the above example.
PHP 7.4+ has a set of functions under the category FFI - foreign function interface, that does precisely what I am looking for. It's overkill for what the questioner wants to do as they refer to a C script
(no such thing), and I haven't tested myself yet. For those interested here's a tutorial on FFI