====== xampp ======
How to add Python onto a xampp installation.
Got this from:
- macouno.com's [[http://www.macouno.com/2010/03/17/getting-python-to-work-on-xampp/|Getting python to work on Xampp]]
- elvenware.com's [[http://www.elvenware.com/charlie/development/web/Python/Xampp.html|Running Python Scripts on Windows with Apache and Xampp]]
===== Configuring the server =====
In the httpd.conf file for your apache installation (part of xampp) add the following all the way at the bottom. In my case the httpd.conf can be found here: ''C:\xampp\apache\conf''
#
# For Python
#
AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict
or append ".py" to the existing ''Addhandler'' command where it is:
AddHandler cgi-script .cgi .pl .asp .py
===== Configuring the python script =====
Then in the top of the python script on your server, it already knows it should be python, but it doesn’t know yet where the python program is. So as the very first line in your python scripts on the server you have to say where python is installed. In my case that looks like this:
#!C:/Python27/python.exe
or,
#!/Python27/python
as opposed to:
#!/usr/bin/python2.5 -u
===== Enabling index.py =====
Of course it’s nice to have index.py files work just like index.php ones as well. So I added index.py to the following bit in the httpd.conf
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml index.py
or update the local directory's .htaccess file:
DirectoryIndex index.php index.html index.py