views:

77

answers:

2

All,

My host supports Perl CGI scripts, how do I use a compiled CGI script on the host?

I tried setting execute permissions via chmod, but when I try and run it via the browser, I get a server error.

Thanks in advance for all help.

A: 

It's possible with a few restrictions:

  1. You're compiling statically or don't have any external dependencies
  2. You're using a glibc that's no newer than theirs

If you're compiling under gcc, you might also need to provide libgcc_s.so which might mean you need a LD_LIBRARY_PATH in which case you'd probably run your binary through a shell script.

You can check the dependencies on your binary with ldd. My recommendation is to compile statically with no dependencies on a system with a glibc at least as old as theirs.

NOTE: (1) above isn't strictly a requirement if you can set LD_LIBRARY_PATH and can run everything through a wrapper script, but things get much more complicated if you need such functionality.

Kaleb Pederson
A: 

perhaps i'm missing something, but the fact that your host supports "perl cgi" doesn't mean that they support "compiled cgi" (which i would presume is a C CGI program).

Some details about what the server error was would be helpful.

mlathe
Actually, yes, it does. CGI is CGI, regardless of the language.
Ignacio Vazquez-Abrams