Results 1 to 8 of 8
Thread: Running python scripts
-
10-12-2004, 08:39 AM #1Web Hosting Guru
- Join Date
- Jun 2002
- Posts
- 302
Running python scripts
My hosting company states it supports Python, but I am not sure how to make python scripts run. What do I need to do in order to make apache run python scripts? (when the script is just uploaded to the server and called directly, the file is handled as a text simple file.)
-
10-12-2004, 10:02 AM #2Web Hosting Master
- Join Date
- Jul 2003
- Location
- Kuwait
- Posts
- 5,104
What extension are you giving your scripts?
-
10-12-2004, 10:06 AM #3Web Hosting Guru
- Join Date
- Jun 2002
- Posts
- 302
.py
.......
-
10-12-2004, 10:26 AM #4Junior Guru Wannabe
- Join Date
- Mar 2002
- Posts
- 86
It'll be different for every server depending on how it is configured, but in general all you need to do is save the script in the cgi-bin directory and then set the file's permissions to allow it to be executable.
-
10-12-2004, 10:45 AM #5Web Hosting Guru
- Join Date
- Jun 2002
- Posts
- 302
Thanks. That's what I did but it didn't work.
-
10-12-2004, 12:20 PM #6Aspiring Evangelist
- Join Date
- Aug 2004
- Location
- Colorado, US
- Posts
- 427
Did you add the correct line to the top of the file?
e.g:
#!/usr/local/bin/python
-
10-12-2004, 01:16 PM #7Web Hosting Guru
- Join Date
- Jun 2002
- Posts
- 302
Yes.
Seems that the problem is in the server and not in what I did.
-
10-12-2004, 01:47 PM #8Aspiring Evangelist
- Join Date
- Aug 2004
- Location
- Colorado, US
- Posts
- 427
Rename the file with a .cgi extension.