Lunarpages Web Hosting Forum

Author Topic: C executable  (Read 4808 times)

Offline davbeck

  • Trekkie
  • **
  • Posts: 12
    • Ultimate Reno Web Design
C executable
« on: June 26, 2010, 02:12:44 PM »
Is it possible to launch a c executable with the shared hosting? Not necessarily as a CGI but from a PHP script.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6429
Re: C executable
« Reply #1 on: June 26, 2010, 04:17:20 PM »
It would have to be compiled and linked with a compiler and library compatible with whatever LP is running for the operating system (some version of CentOS, I think). As compilers and linkers are not installed (or at least, are not available to the common rabble) on shared systems, you would have to set up a clone of your server in order to compile and link.

I would presume that the servers are x86 architecture, but even if you statically linked your module (no shared libraries) I don't know what kind of executable formats (a.out, elf, etc.) would work. I recall several years ago this subject was hashed over quite thoroughly -- if you haven't done so already, a trip down Memory Lane with the search function is in order.

Is there some critical reason that this has to be written in C? If it's so big that CPU load is critical, you'll probably get in trouble anyway for overloading the server. In that case, you may want to talk to LP about VPS and dedicated plans. If what you have is C source for something, consider translating it into Perl or PHP (PHP is quite close to C in syntax). It will run a bit slower than a compiled C executable, but you don't have to go through all the hassle of creating a system to compile and link on.
« Last Edit: July 31, 2010, 04:06:50 PM by MrPhil »
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-