2011-07-21 56 views
3

你知道是否有一个python等效于php的virtual()Python的等价物的PHP的虚拟()

我的配置是蟒蛇,djanogo,mod_wsgi的,阿帕奇

尝试包括具有使用上述包括也需要被包括在所有网站的网页只对PHP的示例脚本。

感谢

LE:我包括cgi的脚本

+1

你能否向本地主机发出CURL请求? – Spudley

+0

为什么你不能只包含文件的常用方式('include'file.php';')? – KingCrunch

+0

@agf:他正在寻找_PHPs_'virtual()'的python- _equivalent_。我很好奇,为什么他要使用'virtual()'或类似'virtual()'的东西,如果可以使用include(),或者 - 因为他现在提到了cgi脚本 - 例如)'exec()'。 'virtual()'是a)仅限Apache的功能,并且b)发出额外的请求。没有很好的理由,它只是开销。 – KingCrunch

回答

0

这个我看到的唯一参考是

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.

这里是t他链接以了解关于Apache过滤器的信息,这是由“链处理”的意思是:

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

文件应该能够通过mod_include处理它从mod_wsgi(或之前的输出后,如果这就是你要)。