【问题标题】:Python equivalent of php's virtual()Python 相当于 php 的 virtual()
【发布时间】:2011-10-10 02:10:54
【问题描述】:

你知道是否有一个 python 等效于 php 的 virtual() 吗?

我的配置是python、djanogo、mod_wsgi、apache

尝试包含一个脚本,该脚本仅包含使用上述包含的 php 示例,并且还需要包含在所有网站的页面中。

谢谢

LE:我包含一个 .cgi 脚本

【问题讨论】:

  • 你可以向 localhost 发出 CURL 请求吗?
  • 为什么不能以常用的方式包含文件 (include 'file.php';)?
  • @agf:他正在寻找 PHPs virtual() 的 python-等效。我很好奇,他为什么要使用virtual()virtual() 之类的东西,如果有人可以使用include(),或者——因为他现在提到了cgi-script——(例如)exec()virtual() 是 a) 仅限 Apache 的功能,并且 b) 触发附加请求。没有充分的理由,它只是开销。

标签: php python virtual equivalent


【解决方案1】:

我看到的唯一参考是

http://www.modpython.org/pipermail/mod_python/2004-January/014834.html

哪些状态In theroy you can use the Apache 2.x chain handlers feature, where more than one content handler can process the request. I say in theroy because I've read about it, but never tried it =)

来自 PHP 手册,virtual() is an Apache-specific function which is similar to <!--#include virtual...--> in mod_include. It performs an Apache sub-request . . . This function is only supported when PHP is installed as an Apache module.

这里是有关 Apache 过滤器的信息链接,这就是“链式处理”的含义:

http://httpd.apache.org/docs/2.2/filter.html

在从mod_wsgi 输出之后(或者之前,如果您想要的话),该文档应该能够由mod_include 处理。

【讨论】:

    猜你喜欢
    • 2010-10-28
    • 1970-01-01
    • 2012-12-03
    • 1970-01-01
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 2013-05-13
    • 2018-08-17
    相关资源
    最近更新 更多