Not able to execute binary file

software development

#1

Hi all

I’m trying to execute a binary file through PHP and SSH but I’m not being able to because I’m getting the following message:

“cannot execute binary file”

The binary file is inside a folder on the root of the user here on Dreamhost and I have changed its permissions with:

Do you know if I have to set any special configuration for this or Dreamhost blocks the execution of this kind of file?


#2

Did you compile it on the server?


#3

No. It was compiled in my local computer and then uploaded to Dreamhost.
How can I proceed?


#4

Upload the source and compile it on your server.


#5

Is this the only way? There are some binaries that must be executed and I don’t have the sources to them.
Please advise.


#6

What does running

give you?


#7

Running this command in SSH I am returned the following:


#8

Curiouser and curiouser. That’s not a compiled file. I suspect some kind of libtool weirdness.

Any chance you can email me (button at the bottom of my post) with your login username and the location of this file? It’s probably going to be easiest if I can look at this directly.


#9

Sure Andrew.

I just did it.
Please advise.

Cassio


#10

The executable you’re looking at was compiled on a Mac OS X machine. It cannot be run on a Linux server.


#11

Thanks Andrew! I have replaced the binary with one compiled for Linux and it worked.