如何在 Linux Web 主机上运行编译为 Linux 二进制文件的 CGI

发布于 2024-08-19 11:15:18 字数 128 浏览 2 评论 0原文

所有,

我的主机支持 Perl CGI 脚本,如何在主机上使用编译好的 CGI 脚本?

我尝试通过 chmod 设置执行权限,但是当我尝试通过浏览器运行它时,出现服务器错误。

预先感谢所有帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

喜爱皱眉﹌ 2024-08-26 11:15:18

有一些限制是可能的:

  1. 您正在静态编译或没有任何外部依赖项
  2. 您使用的 glibc 不比他们的新

如果您在 gcc 下编译,您可能还需要提供 libgcc_s。 so 这可能意味着您需要一个 LD_LIBRARY_PATH 在这种情况下您可能会通过 shell 脚本运行二进制文件。

您可以使用 ldd 检查二进制文件的依赖关系。我的建议是静态编译,不依赖于 glibc 至少与他们的系统一样老的系统。

注意:(1)如果您可以设置 LD_LIBRARY_PATH 并可以通过包装器脚本运行所有内容,那么上面的内容并不是严格的要求,但如果您需要这样的东西,事情会变得更加复杂功能。

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.

近箐 2024-08-26 11:15:18

也许我错过了一些东西,但事实上你的主机支持“perl cgi”并不意味着他们支持“编译的cgi”(我认为这是一个C CGI程序)。

有关服务器错误的一些详细信息将会有所帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文