Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2002
    Posts
    302

    Question 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.)

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,104
    What extension are you giving your scripts?

  3. #3
    Join Date
    Jun 2002
    Posts
    302
    .py

    .......

  4. #4
    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.

  5. #5
    Join Date
    Jun 2002
    Posts
    302
    Thanks. That's what I did but it didn't work.

  6. #6
    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

  7. #7
    Join Date
    Jun 2002
    Posts
    302
    Yes.

    Seems that the problem is in the server and not in what I did.

  8. #8
    Join Date
    Aug 2004
    Location
    Colorado, US
    Posts
    427
    Rename the file with a .cgi extension.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •