[Twisted-web] PHP support on Windows

Abdallah Deeb abdallah.deeb at gmail.com
Sun Nov 13 02:10:28 MST 2005


> Do you install  pywin extension from ...
if by pywin you mean Mark Hammond's win32 extensions, then they are installed.

> Are you, as the error message suggests, using the win32 reactor?
replacing the default reactor with the win32 reactor removes the error
and everything else ... the program runs, but does not respond to any
requests. I might be doing it the wrong way though. Could you give me
an example on how to use the win32 reactor. here's what I have so far:
(and it's not working)

import os
from twisted.internet import reactor, win32eventreactor
from twisted.application import internet, service
from twisted.web import static, server, twcgi, script

class PHPScript(twcgi.FilteredScript):
    filter = 'c:\\PHP\\php.exe'

root = static.File(os.getcwd())
root.processors = {
            '.php': PHPScript,
            '.epy': script.PythonScript,
            '.rpy': script.ResourceScript,
}
application = service.Application('web')
site = server.Site(root)
reactor = win32eventreactor.Win32Reactor()
reactor.listenTCP(1999, site)
reactor.run()



More information about the Twisted-web mailing list