开发者

howto run a cgi that is compiled as a linux binary on a linux web-host

All,

开发者_JAVA技巧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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜