I created a test app in C as follows:
#include<stdio.h>
int main(void){
printf("Hello World!\n");
return 0;
}
I compile via the following command on my MacBook Air, running OS X Yosemite:
$ cc foo.c -o foo
I then upload the "foo" binary to my CentOS VPS, CHMOD 755, then attempt to execute via the following command:
$ ./foo
This returns the following result:
-bash: ./foo: cannot execute binary file
I also attempted to compile with -m32 in case it was a 64/32 bit conflict. The same result was produced.
Why will CentOS will not execute the binary?
foohas execute permission?file footo see what is the output