I have a C program I have compiled to a exe called crunch.
It takes a string and returns a hash string. It has worked for a long time but I just needed to make a small change to it. It works perfectly in terminal as such:
./crunch url-string/with-file.jpg
Spits out a nice hash string. In my php I have been executing it as such:
$crunch = '~/domains/somewhere.net/html/api/crunch';
$code = `$crunch $code`;
$code = mysql_real_escape_string(trim($code));
$code is initially a string which is an URL. It has been returning a hash but not any more.
I have recompiled the C a few times. Just don't get it, I have tried php exec() , passthru().
FIXED:
The issue was the difference between my Mac Unix distros and the linux server. The fix was to log into my server and compile the .c file there.
Bobs your Uncle, works again.
Thanks peeps, I did check everyones advice. Sometimes ruling out possible breaks helps focus on the issue. Virtual beers(or sparkling water) all around!
../crunch.exeinstead of just../crunch?~/with the exact path?