gpt4 book ai didi

c++ - 在主机上设置 .htaccess 以执行 C++ cgi 脚本

转载 作者:行者123 更新时间:2023-11-28 03:39:32 24 4
gpt4 key购买 nike

我有一个我知道有效的 cgi 脚本(就代码而言),但无法通过我的网站访问。我的托管服务提供商只是说我需要编辑 .htaccess 文件,但我不知道我需要设置哪些选项/处理程序才能使目录的内容像 C++ 一样执行。

这是怎么做到的?

最佳答案

您不能使用此服务提供商。快速搜索 Bluehost Kb 给出了这个:https://my.bluehost.com/cgi/help/48

Our LINUX web servers have the capability to run CGI scripts in your own "cgi-bin" directory. Scripts may be written in Perl, Python and CGI languages.

Here are some helpful tips to follow when installing scripts:

  • Upload to your cgi-bin directory to ensure proper file permission settings.
  • All scripts on our server must have permissions set to 755 (rwx-rx-rx). If you need help in changing script permissions, please see our article about setting file and user permissions.
  • Upload in ASCII transfer mode (and NOT BINARY mode) The first line of each script must read: a) #!/usr/bin/perl (for Perl) b) #!/usr/bin/python (for Python)
  • Ensure the permissions are set to 755

但是,没有什么可以阻止您只是尝试将您的 exe 放在 cgi-bin 目录中并查看它是否运行,但这可能行不通。

在这种情况下,您需要将任何 C++ 重新链接到本地​​目标服务器,我怀疑 Bluehost 是否会促进这一点——对于您每月支付的几美元来说,支持太麻烦了。

关于c++ - 在主机上设置 .htaccess 以执行 C++ cgi 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9741653/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com