C:\wamp\bin\apache\Apache2.2.11\conf>notepad httpd.conf
Then search for the line containing "addhandler" and write:
AddHandler cgi-script .pyFor python scripts (for any other scripting language, just use the relevant extension).
Then the first line of your script should contain the path to the python program:
#!c:/Python26/python.exe -uAccording to python cgi on windows.
Place your script in C:\wamp\bin\apache\Apache2.2.11\cgi-bin\myscript.py and you're done.
The output of the script can be accessed at
http://localhost/cgi-bin/myscript.py
The script works but there are restrictions on the modules I can import. I can import native python modules, but not the module I made myself in other places outside the cgi-bin folder. I don't know how to solve that yet. (This is probably a security restriction)
1 comment:
thank you. Your suggestion helped.
Post a Comment