如何在 Linux Web 主机上运行编译为 Linux 二进制文件的 CGI
所有,
我的主机支持 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一些限制是可能的:
如果您在 gcc 下编译,您可能还需要提供 libgcc_s。 so 这可能意味着您需要一个
LD_LIBRARY_PATH
在这种情况下您可能会通过 shell 脚本运行二进制文件。您可以使用 ldd 检查二进制文件的依赖关系。我的建议是静态编译,不依赖于 glibc 至少与他们的系统一样老的系统。
注意:(1)如果您可以设置 LD_LIBRARY_PATH 并可以通过包装器脚本运行所有内容,那么上面的内容并不是严格的要求,但如果您需要这样的东西,事情会变得更加复杂功能。
It's possible with a few restrictions:
If you're compiling under gcc, you might also need to provide
libgcc_s.so
which might mean you need aLD_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.也许我错过了一些东西,但事实上你的主机支持“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.