Trouble running python script as cgi under apache (ubuntu 12)

后端 未结 6 1787
再見小時候
再見小時候 2021-02-07 15:31

Disclosure: I searched a lot, and I don\'t think my question (for my configuration) is answered here. For example run python script as cgi apache server doesn\'t answer it.

6条回答
  •  面向向阳花
    2021-02-07 15:42

    In my case (which is a shared unix machine), I also need to create a hidden file ".htaccess" with the following:

    Options +ExecCGI
    SetHandler cgi-script 
    

    It is also important to set the permissions accordingly (755 - group and other with no writing but execution permissions) as well as having:

    #!/usr/bin/python
    

    as a first line of the python CGI script.

提交回复
热议问题