How to execute binary script?

software development

#1

Hello,

I have a binary script, written on C.
It reads input from stdin and writes output to
stdout. I’ve uploaded it to my host and set attrinutes to 755.
Now I want to call my script using URL:
http://mydomain.com/script?prm1=x&prm2=y
But instead of executing the script browser just show me contents of the script file.

How to solve this problem?


#2

You are aware that C needs to be compiled and you “run” the compiled program, right?

Wholly - Use promo code WhollyMindless for full 97$ credit until 12/11/07.


#3

Yes, of course I have a compiled binary file.
I used this file on another hosting. It was enough to upload the file and set attributes to 755 to make it executable.


#4

It sounds like a mime-type issue. Have you tried naming the file “script.cgi”, and changing your url to “http://mydomain.com/script,cgi?prm1=x&prm2=y” ?

–rlparker


#5

Could you show us how you’re trying to call the binary? Is there any chance your old host was not on a linux system? Maybe BSD?

Wholly - Use promo code WhollyMindless for discount.


#6

Thank you! That solved the problem!


#7

You are most welcome, and I am really glad you have it sorted now! :slight_smile:

–rlparker


#8

Good to hear!

Wholly - Use promo code WhollyMindless for discount.