I am trying to run a php script on a webserver written in twisted.For that i
am using twcgi module.
Here is my code.
This is code for webServer.py ->
from twisted.internet import reactor
from twisted.web import static,script,twcgi,server
from twisted.python.log import startLogging
import sys
class PHPScript(twcgi.FilteredScript):
filter='/media/DATA/Documents/project-docs/twisted/twisted-programs/testPHP/twisted-php.py'
root=static.File('html_files')
root.indexNames=['index.php']
root.processors={'.php':twcgi.PHPScript}
site=server.Site(root)
reactor.listenTCP(8000,site)
startLogging(sys.stdout)
reactor.run()
And here is another file used in program twisted-php.py ->
#!/usr/bin/env python
> import os, sys, commands
> print "Content-type: text/html\n\n";
> command = 'php ' + sys.argv.pop(1)
> data = commands.getstatusoutput(command)
> print data[1]
>
Now my problem is if i try to acess some url like
http://localhost:8000/list.php then everything works fine but if i enter url
with parameters like http://localhost:8000/list.php?file=sample.txt then
twisted is not passing parameters after '?' to twisted-php.py
I verified this in twisted-php.py
Is there any way i can use such php scripts with parameters in twisted?
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python