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.

No correct solution


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 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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow