Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are running on a linux box, dont use mod-rewrite - rename the script. </p> <p>you can call the script - pythonscript not pythonscript.py </p> <p>you add to the first line of the script pointing to your python interpreter </p> <p>and set the file to be executable </p> <p>with </p> <pre><code>chmod +x pythonscript </code></pre> <p>when the file is executed - it will read the first line of the file and execute the interpeter in the first line</p> <pre><code>#!/usr/bin/python </code></pre> <p>and then set the directory to execute the script </p> <p>to make this work, you change the files in the directory executable in your .htaccess file</p> <pre><code>basics/.htaccess ----------- Options +ExecCGI SetHandler cgi-script ----------- </code></pre> <p>Your python script will look like this</p> <pre><code>basics/pythonscript ------- #!/usr/bin/python print "STATUS: 200 OK\n\n" print "hello world" ------ </code></pre> <p>Warning... You may get an error in your error_log file that looks like this. </p> <pre><code>[Thu Aug 05 19:26:34 2010] [alert] [client 127.0.0.1] /home/websites/testing/htdocs/basics/.htaccess: Option ExecCGI not allowed here </code></pre> <p>If that happens your webserver is not allowing the changes from your .htaccess file</p> <p>Your webserver will need to be able to allow changes in your htaccess file so you may need to enable Allowoverride All in your httpd.conf file </p> <pre><code>&lt;Directory "/"&gt; .... Allowoverride All &lt;/Directory&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload