【问题标题】:Ignore Apache directive 'ScriptInterpreterSource' on linux在 Linux 上忽略 Apache 指令“ScriptInterpreterSource”
【发布时间】:2012-01-30 14:59:04
【问题描述】:

我有一个小的 python 脚本来生成 css 文件(使用 PyScss)。网站的其余部分是 PHP。

实时网站托管在 linux 服务器上,但代码还需要在 Mac 和 Windows 机器上运行(用于开发)。

我认为一个好的老式 cgi 脚本会很好(结果将被进一步缓存),主要是因为我的 windows 设置 (EasyPHP) 似乎没有附带 mod_fcgid(我不能使用 mod_wsgi或 mod_python 在这种情况下,因为我需要一个比我们正在使用的 apache 内置的更新的 Python)。为了让它工作,我需要使用 ScriptInterpreterSource(希望 linux/mac 只使用 shebang),但是当我在 linux 服务器上部署时出现错误:

Invalid command 'ScriptInterpreterSource', perhaps misspelled or defined
   by a module not included in the server configuration

如何让 linux(和 mac)apache 忽略该指令(或者您可以提出其他解决方案)?

谢谢。

【问题讨论】:

    标签: windows linux apache cgi


    【解决方案1】:

    尝试使用:

    <IfModule mpm_winnt_module>
    ScriptInterpreterSource ....
    </IfModule>
    

    只有在 Windows 上使用 Apache 时才会使用该指令,否则将被忽略。

    【讨论】:

    • 完美,谢谢。我使用的是 因为我的 wamp 没有那个模块,这更明智。
    猜你喜欢
    • 2010-10-27
    • 2010-09-27
    • 2011-08-23
    • 1970-01-01
    • 1970-01-01
    • 2021-04-11
    • 2014-05-12
    • 2014-01-06
    • 1970-01-01
    相关资源
    最近更新 更多